Please note, I'm using the Fedora 17 Beta, but this should work on older versions as well. Each of these commands should be run in a Terminal window.
First, ensure you have your Fedora install up to date:
sudo yum update
Next, let's install the prerequisites we will need:
sudo yum install git-core curl make bzip2 gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel libxslt-devel sqlite sqlite-devel openssl openssl-devel
We are now ready to install RVM:
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
...followed by,
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bashrc
Optionally, you can add the following to the end of your
.bashrc file to gain additional git features in your bash prompt:
PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
Finally, reload your
.bashrc file with the following command:
. .bashrc
Ensure that RVM is loaded with the following command, which should output "rvm is a function":
type rvm | head -1
The following steps will install Ruby, Rails and the Sqlite3 gem. Execute these in order:
first,
rvm install 1.8.7
then...
rvm use 1.8.7 --default
and then...
rvm install 1.9.3
after that...
rvm use 1.9.3 --default
followed by...
gem install rails
...and finally,
gem install sqlite3After that, check out some code and bundle it up (
bundle install) or create a new rails app (rails new testapp).
Thanks for the guide! As a note for people to prevent issues... these instructions are for a SINGLE USER install. so, only run the yum installer with sudo and ensure that you do NOT use root to install rvm. This means that you run bash -s stable |curl... as your user account.
ReplyDeleteIf you get a permission error, close out of your terminal window and reopen and try again. This should restore your settings so it's running as you. ("Exiting" out of a sudo session may not do the trick)
Curious to know why you first installed version 1.8.7 and then installed 1.9.3?
ReplyDeleteAshwin, I wanted both installed - I have a project that is in 1.8.7 that I haven't converted just yet. It could probably be handled w/ a RVM Gemset though, I just do it this way. I'm sure there is a better way.
ReplyDeleteThis is a good guide and did get me up and running. But I can't get WebBrick working, any advice on solving the ExecJS requirement??
ReplyDeleteTry adding
ReplyDeletegem 'execjs'
gem 'therubyracer'
to your Gemfile.
FYI:
ReplyDelete"Hello! The sqlite3-ruby gem has changed it's name to just sqlite3. Rather than
installing `sqlite3-ruby`, you should install `sqlite3`. Please update your
dependencies accordingly.
Thanks from the Ruby sqlite3 team!"
Thanks Jasper - I've updated the post.
ReplyDeleteSuper stuff Jayson. Thanks much, saved me tons o' time!
ReplyDeleteSame here. Thanks! /me bookmarks
ReplyDeleteThat .bashrc edit was terrific! Thanks
ReplyDeleteThanks dude you are the supreme geek xD
ReplyDeletehello, i add into .gemrc the next 2 lines
ReplyDeleteinstall: --no-rdoc --no-ri
update: --no-rdoc --no-ri
if people are getting errors on rvm install x try --> sudo chown -R USERNAME /usr/local/rvm
ReplyDelete