RVM Installation on FreeBSD
There are a few good steps outlined on the RVM website. This document is mostly echoed from those steps: RVM install
The author (originally Wayne Seguin) offers probably the best tech support available. He is on webchat.freenode.net, but you'll have to authenticate in order to post. The best route is to Register on freenode, setup a username and login to the #rvm channel with authentication. The web interface is pretty nice.
NOTE: the web interface at webchat.freeneode.net accepts input for the following commands at the bottom of the page.
To register on freenode as user: someuser with password: mypassword and email: someuser@mailer.com, first enter the cpatcha to get past the opening screen to be able to talk to the nickserv. Then, in the entry bar at the bottom, enter:
/msg nickserv info someuser
/nick someuser
/msg nickserv register mypassword someuser@mailer.com
/msg nickserv set hidemail on
Then you'll gedt an email at someuser@example.com with a nickserv command to confirm your registration. Just cut and paste the command verbetim. Login again. For every login, just enter the following:
/msg nickerv identify someuser mypassword
/join #rvm
Basic Installation
Install git, bash and curl as root. All other steps (except for system-wide dependency installs) should NOT be run as root. When dependencies are installed, run bash and and update your .bashrc with this line:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
Then:
chmod 600 .bashrc
and edit .profile, adding the line as the last in the file:
source ~/.bashrc
Log out of the console, and log back in to make sure everything works. Now fetch rvm:
\curl -s https://get.rvm.io | bash -s stable
Logout and log back in again. To test the rvm installation, it should say "rvm is a function" when the following is typed:
type rvm | head -1
Updating the install
You should probably run these 2 commands each time you login to your shell, but do it now to make sure you have the newest version:
rvm get head
rvm reload
Getting Dependencies and Ruby
You'll have to check the notes for your platform:
rvm notes
NOTE: You'll have to install a bunch of dependencies as root. For Ubuntu, for example it will give a list of packages to install:
ruby: /usr/bin/apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
To find out which Rubies you can install, type:
rvm list known
Now for the ruby installation (NOT done as root). Just choose the version, and run the following:
rvm install 2.0.0 where the ruby version is 2.0.0-[x]
This will take some time to build, since it's being built from source. Also, there will be no screen messages during the build process. When completed, both ruby and rubygems will be installed somewhere under your .rvm directory.
Setting default Ruby & Gems
If this is the first installation, you won't have any ruby or gems defined by default. So, to set your default ruby to ruby-1.9.2-p180 enter:
rvm --default use ruby-1.9.2-p180
rvm list
The above lines will display which version is the current default. You can further verify with:
ruby --version
gem --version
Next, set your default gemset to something bound to the purpose (say rails3)
rvm --create use 1.9.2@rails3
This tells rvm to use ruby1.9.2 paired with the gemset called rails3. What happens is that rvm creates a separate set of gems to use with rails-1.9.2. If you should ever need to use another ruby and another version of gems, you can have multiple combinations hanging around, and simply tell rvm which one you would like to use. To verify the current gemset, type:
rvm gemset list
You should see an entry for "global" and your special gemset: rails3. At this point, you should update your gems to the latest. This is done by:
gem --version
gem update --system
gem --version
You should see the version jump to the latest (currently 2.0.0.)
Installing rails (optional)
That should be it for the ruby installation. You can run ruby normally as the current user without worries. RVM basically intercepts calls to ruby and its utilities, and allows you to have everything installed in your local directory, as well as multiple versions of Ruby and Gems, which are kept as "Gemsets".
Before installing Ruby on Rails, it's worth visiting the Rails website to determine the correct version. At Rubyonrails.org there are three available, the release candidate (unstable), the dot-zero version (too old) and the bugfix version. In this case, the bugfix version is 3.0.7 so we will install that:
gem install rails --version 4.0.1
All dependencies should binplace locally (in the .rvm subdirectory) and without the need for root access. You should be able to see what's installed with:
gem list
If any troubles occur, or there is a need for build-time modifications, you can always poke around in the sources in the .rvm directory to customize anything you install.
Maintenance
rvm get head
rvm reload