
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.
-
Open terminal then execute
\curl -L https://get.rvm.io | bash -s stable - 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. - 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 fithen execute
source ~/.bashrc. RVM doesn’t recommend this. Do this at your own risk. - Verify
rails new test-app- cd test-app
- rails server
- Open a browser then go to http://localhost:3000
- If you encounter ExecJS::RuntimeUnavailable error when executing
rails serverinstall node.jssudo 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.
Reblogged this on Ruby On Rails Blog.