Tags

,

rails

RoR can be installed by first installing Ruby, then RubyGems and finally Rails. The recommended way as of today is to install those components via RVM.

  1. Open terminal then execute \curl -L https://get.rvm.io | bash -s stable
  2. Open new terminal then execute source ~/.rvm/scripts/rvm. This command would put
    [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM function
    to ~/.bash_profile.
  3. In my case, Konsole does not run as login shell. Which means it doesn’t read ~/.bash_profile. As a workaround, add the codes below in ~/.bashrc
    if test -f ~/.rvm/scripts/rvm; then
        [ "$(type -t rvm)" = "function" ] || source ~/.rvm/scripts/rvm
    fi

    then execute source ~/.bashrc. RVM doesn’t recommend this. Do this at your own risk.

  4. Verify
    1. rails new test-app
    2. cd test-app
    3. rails server
    4. Open a browser then go to http://localhost:3000
  5. If you encounter ExecJS::RuntimeUnavailable error when executing rails server install node.js
    sudo add-apt-repository ppa:chris-lea/node.js
    sudo apt-get update
    sudo apt-get install nodejs npm

Desclaimer: I’m a newbie in rails. I documented what I encountered and what I searched across the net so that I have a guide next time I install rails.

Advertisements