This tutorial will show you how to install Ruby on Rails on a base install of Ubuntu Linux. This tutorial should also work for any similar Linux distributions, such as Kubuntu, Xubuntu, or any Debian-based distribution.
We'll start with a base install ("server" install in Ubuntu), but you can do a graphical install as well if you don't want a command line only when you log in
.
So let's get started!
NOTE: anything marked in these:
Offline
Step 6 is a horrible idea. The correct thing to do is to install the "ruby" package via apt-get. This ensures that /usr/bin/ruby points to the current Ruby installation in the future, without manually interfering with system directories.
Offline
Very helpful article, thanks.
Two things; I followed this to install on Ubuntu 6.06 LTS! desktop. I used the Synaptic Package Manager for Ruby and Step 6 is required, as it installed as ruby1.8. Also mongrel appeared to install, but would not run. Fixed by using Synaptic Package Manager to install "build-essential", then gem uninstall mongrel and then re-install. To see any errors in mongrel leave off the -d option in step 10.
Last edited by mconiegs (2006-08-31 12:12:46)
Offline
Yeah! You should definitely use apt-get to install ruby.
You also have to install the "build-essintial" package to successfuly install Mongrel. You need it because parts of Mongrel are in C/C++ and have to be compiled when installing.
If you don't have build-essential installed, Mongrell will install, but it will fail to start with an error like this:
** Starting Mongrel listening at 0.0.0.0:3000
/usr/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/
mongrel.rb:666:in `register': undefined method `resolve' for
nil:Mongrel::URIClassifier (NoMethodError)
Offline
I uninstall ruby and sqlite3 and went through the post again and all worked fine except that using apt-get with ruby, (step 1), gave me a strange result in that there was no ruby executable in /usr/bin, although the sym-link was there.
I did a synaptic re-installation and it all worked fine. I assume it was me, but just thought I would share incase anyone else had an issue.
Again thanks for easy and helpful article.
Offline
After I installed rails as instructed above, I got the following error:
Routing Error
Recognition failed for "/rails/info/properties"
Any help would be appreciated.
Offline
Dieter Komendera wrote:
Yeah! You should definitely use apt-get to install ruby.
You also have to install the "build-essintial" package to successfuly install Mongrel. You need it because parts of Mongrel are in C/C++ and have to be compiled when installing.
If you don't have build-essential installed, Mongrell will install, but it will fail to start with an error like this:
** Starting Mongrel listening at 0.0.0.0:3000
/usr/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/
mongrel.rb:666:in `register': undefined method `resolve' for
nil:Mongrel::URIClassifier (NoMethodError)
I'd love to rely on the apt-get packages but the versions lag behind by a significant delay. The last I checked the ruby package was still at 1.8.4, and for the longest while it was at 1.8.3, which was completely unusable for a rails deploy.
So while I agree using the package system is usually the best bet, there are times that it just doesn't get the job done.
Offline
Hi all
I am getting problem in configuring eclipse for ruby on rails. I am refering a tutorial at the following link
file:///C:/Documents%20and%20Settings/Jain/Desktop/Sonjaya%20Tandon%20%BB%20HOW-TO%20%20Configure%20eclipse%20for%20Ruby%20on%20Rails.htm
I am getting problem in step 19. After configuring RDT plug-in and Rad Rails plug-in, rails Installs does not appear. So when I try to create a new rails project,following error appear:
rails is not recognized as an internal or external command.
and the necessary files are not generated.
I dont know what to do. Please help me out.
Offline
You should definitely NOT use apt-get to install ruby if you are running 64-bit Ubuntu. I set up my new Opteron system a few weeks back to be a rails dev machine. If anybody runs into problems, drop me a line.
Offline
I'm getting an error after step 6:
root@root-desktop:~$ sudo gem update --system
/usr/bin/gem:23: uninitialized constant Gem::GemRunner (NameError)
root@root-desktop:~$ sudo gem install mongrel
/usr/bin/gem:23: uninitialized constant Gem::GemRunner (NameError)
Offline
cray,
Please post what gem -v gives out.
As for the tutorial, I don't understand why everything is not installed at once, like so:
sudo apt-get install ruby ruby1.8-dev irb sqlite3 rubygems build-essential
Offline
Radar,
gem -v gives me the same error:
/usr/bin/gem:23: uninitialized constant Gem::GemRunner (NameError)
does the installations method u suggested , install ruby on an apache or mongrel server?
thks!
Offline
Cray,
This is a fairly common issue when you upgarde rubygems to 1.0+, you need to add the line
require 'rubygems/gem_runner'
to the /usr/bin/gem file
On another note:
The original post is a bit outdated, I'd skip steps 3 - 6 and instead install the apt-get package for rubygems and then issue an upgrade if I want to ensure I'm on latest so something like:
sudo apt-get install ruby ruby1.8-dev irb rubygems build-essential
followed by
sudo gem install rails mongrel
should be enough to get you going
Offline
Thanks sambo.Gems aint fussing now.
But It now gives me a new error.
"aeshan@aeshan-desktop:~$ sudo gem install rails --include-dependencies
sudo: must be setuid root
"
whats setuid?
Thanks
Offline
Offline
Thanks for the nice HowTo. Just installed it on Pardus Linux.
Offline
Here is a step by step procedure for installing Ruby on rails
http://iweavers.blogspot.com/2008/07/ho … buntu.html
Offline