Installing Ruby on Rails
The installation process for Ruby on Rails is different depending on whether you
are running Windows, MacOS, or Linux:
Windows
- Install Ruby. To do this, download the file
rubyinstaller-1.8.7-p299.exe
, execute it,
and follow the instructions to install Ruby in the default location
(C:/Ruby187
). Select the checkbox that adds the
Ruby binary directory to your Path.
- Install Gems (Ruby's packaging mechanism). To do this, download
the zip file
rubygems-1.3.7.zip
. Inside the zip file
is a folder named rubygems-1.3.7
; extract this folder to
C:\rubygems-1.3.7
. Open a cmd window, cd to
C:\rubygems-1.3.7
, make sure there is a file
setup.rb
in that directory, then invoke the following command:
- Use the Gem system to install Rails. To do this, invoke the
following command:
gem install rails -v 2.3.8
Be sure to specify the version (-v 2.3.8
); if you don't, then
you will get a newer version of Rails. This was released shortly before
the beginning of the term and we had some problems with it, so we
recommend staying with the older version.
- Install Sqlite3. To do this, download the zip file
sqlitedll-3_7_0_1.zip
, open the zipped folder, and
copy the two files in it to C:/Ruby187/bin
. Then use the
Gem system to install the Ruby connector:
This may print out several warning messages, which you can ignore.
Mac OSX 10.6/10.5 (Snow) Leopard
- To get started, you need to install XCode, but note that
you will NOT be developing in XCode, you just need to have it
installed. You can grab the dmg file here:
http://developer.apple.com/technology/xcode.html. We recommend
the iPhone version if you have any interest in doing iPhone dev
at any point. Also, you'll have to sign up for a free ADC account
to download XCode.
- Since Leopard includes an installation of Ruby on Rails by
default, all that is required is updating your installation of Ruby,
Gems (Ruby's packaging mechanism) and Rails. Follow the instructions
below in order in your terminal. Some people have reported that the
Rails update step failed the first time, but succeeded when they
tried it again:
sudo gem update
you may see ERRORs all over the place, but really ok
sudo gem update --system
updates to latest version of ruby
sudo gem install rails -v 2.3.8 --include-dependencies
Updates Rails to the right version for this class
- Install Sqlite3. MacOS Leopard already has Sqlite3 pre-installed,
so all you need to do is install the Ruby connector:
sudo gem install sqlite3-ruby
This may print out several warning messages, which you can ignore.
Linux
- Check out
Installing Ruby on Rails in Linux. The instructions include
almost everything you should need for the project, except don't
install MySQL as described in the instructions. Please note that
we have only skimmed this page. We have not tested the
instructions! If you have any problems, post on the
class newsgroup so that TA's or other students can help you.
- Install Sqlite3. We think that the following instructions
should work, but we haven't tested them. Download the file
sqlite-3.7.0.1.so
and copy it to the directory
containing the Ruby executable. Then use the
Gem system to install the Ruby connector:
This may print out several warning messages, which you can ignore.