Rails is the web application framework written in Ruby language. In this tutorial I will show you how to install Rails, and how to solve some problems in installing it. Because it also gave me a headache when I first tried to install it.
First, you have to make sure that rails isn’t already installed. As usual, type this on your command line window:
It will give you a list of the gems that are installed. Gems are simply components that adds functionality to the web applications that you’re going to create.
In the screenshot above, you can see that rails isn’t installed yet.
To install rails, simply type:
gem install rails
Wait for about 3-5 minutes. If it returns an error like this:
ERROR: While executing gem ... (Gem::FormatException)
builder-2.1.2 has an invalid value for @cert_chain
Then you’re lucky since were going to solve it here.It seems like Ruby version 1.9.2p180 isn’t compatible with Gems version 1.7.1
So what we have to do is to downgrade either of them. But to make life easier, I’ll choose to downgrade Gems. To do that just type:
gem update --system 1.6.2
And that command will downgrade 1.7.1 to 1.6.2.
Now you’re ready to install rails. Open up a new command line window just to be sure.
If you see something like the one below, then you’re good to go. Just wait for about 5 minutes to finish downloading and installing rails.