Installing Ruby on Rails on Ubuntu
This guide is valid for the following distributions:
While there is a nice tutorial in the Ruby on Rails wiki, it’s by no means complete. According to it, you should only type: apt-get install rails to have the newest Rails installed on Ubuntu. It installs both Ruby and Rails, but what about rubygems? Sorry, not this time. There is also another caveat. Although commands like rails test and ruby script/server are working properly, ruby/console is not. If you had the misfortune of experiencing the aforementioned behavior, then this tutorial is just for you.
Pre requirements:
nano /etc/apt/sources.list
Add the following at the end of the file (replace edgy with breezy if you are running Breezy, dapper for Dapper, etc.):
# All Ubuntu repositories deb http://archive.ubuntu.com/ubuntu edgy main restricted universe multiverse
Update your apt sources:
apt-get update
Installation:
Install Ruby with developer’s libraries:
apt-get install ruby ri rdoc irb ri1.8 ruby1.8-dev libzlib-ruby zlib1g
Download and install Ruby Gems (no .deb package, unfortunately):
wget http://rubyforge.org/frs/download.php/17190/rubygems-0.9.2.tgz tar xfvz rubygems-0.9.2.tgz cd rubygems-0.9.2 ruby setup.rb
Update your RubyGems (also updates the gems cache):
gem update --system
If you get Could not find rubygems-update (> 0) in the repository or a similar error, you need to delete your RubyGems cache:
$ gem env gemdir PATH_TO_DEFAULT_GEM_REPOSITORY $ rm PATH_TO_DEFAULT_GEM_REPOSITORY/souce_cache
and
rm $HOME/.gem/source_cache
In the next step install the OpenSSL bindings for Ruby (needed to install signed gems). They are required if you get the following error: SSL is not installed on this system, while installing signed gems like rake:
apt-get install libopenssl-ruby
And the last one:
gem install rails -y
And this is basically it. There are, however, depending on your needs, some…
Additional steps:
One of them is setting up the Rails to connect to the MySQL database in a proper way. We will be using the MySQL C bindings, which, for one, support the MySQL old style passwords (which is set as default for Ubuntu 5.04), but are also significantly faster (in the 2-3x range) than the native Ruby MySQL bindings. First, we will need to install the gcc compiler (and libc6-dev if you don’t have it already installed). Although strange it may seem, as a default it is not installed on a clean Ubuntu installation.
apt-get install gcc libc6-dev
MySQL development libraries are also required (mysql_config plus mysql/include):
apt-get install libmysqlclient14-dev
(for MySQL 5.0 you might be better of with libmysqlclient15-dev).
And now we can install C MySQL bindings:
gem install mysql
If you get "sh: make: not found" do:
apt-get install make
or if you have it already installed, add it to your path:
export PATH=/usr/bin:"${PATH}"
And, of course, in the end install Mongrel:
gem install mongrel -y
And that’s it. Rails installation is complete. Complicated? Not really
Happy coding!


September 20th, 2005 at 10:02 pm
Heh – I don’t have a linux box at home, so I’m tinkering (yeah – that’s a good description, since I always suffer from lack of time…) with my rails skills on winXP box with apache and mysql installation. That was rough, when I was trying to make rails talk to mysql. Later – I found out that the problem was Ruby MySql Bindings – so I had to reset my default RubyonRails account on mysql to use that new hashing method for passwords (16 bits, as I remember ?)…
btw – as for that plugin with ratings – thanks – I think I’ll pass – I decided to not rate things in my ‘kind a’ reviews. thanks for offer anyway.
September 21st, 2005 at 7:02 am
You might want to play a bit with checkinstall. I haven’t used it myself, yet, but using it for installing rubygems should work, and I imagine one might as well try checkinstalling the following gems one by one. Always a bit more ‘proper’…
September 21st, 2005 at 8:01 pm
jarv -> When I develop on Windows box in RoR I don’t have very high ’standards’ regarding security or configuration. Meaning, that I’ve just used the one-click installation pack and it simply worked “out of the box”. Root without password, etc.
Shot -> Checkinstall seems a little bit complicated, but yes, it’s definitely a cleaner way to install rubygems. Not that it matters that much, because rubygems are supposed to be a part of Ruby 1.8.4 release, due out in December.
September 22nd, 2005 at 10:52 am
As I wrote above, I’ve yet to use checkinstall, but from what I understand, you simply prepend the ‘ruby setup.rb’ and ‘gem install …’ commands with ‘checkinstall -D’ (as in ‘checkinstall -D ruby setup.rb’ and ‘checkinstall -D gem install rails –include-dependencies’) and you end up with a simple .deb package for installation; doesn’t seem to be too complicated, at least in theory. I might be wrong, though.
As for Ruby 1.8.4 coming in December, it might not make it into dapper (the same way the final Ruby 1.8.2 didn’t make it into hoary); though in this case it should be available in the -backports, so I agree that there will be an easier way to install it, anyway.
September 22nd, 2005 at 5:19 pm
Well… I’m not used to have some open services left on my machine without password – and in this case – my XPbox is connected directly (it has own IP) – so – I just don’t want to take any risks ;].
Apart from that – I’ve got another problem – I can’t make Rails work under Apache. Got my FastCGI set up… but still no effects…. I had no time for further investigation – but sooner or later – I will have to.
Or maybe not – as me and two of my friends are thinking about buying hosting on Dreamhost… ;]
September 24th, 2005 at 10:45 am
shot -> There will also be plain Debian packages with Ruby, which you could use as well (I think).
jarv -> Try Lighttpd + FastCGI – it’s much simpler to set up than apache2. Now as for the Dreamhost, it’s great to have your site hosted there, but it’s a PITA for development work (in the change & refresh fashion) as pings from Poland to USA are well over 150ms (which kills interactivity). Development should always be done on the localhost or on LAN connected machine. As for the Dreamhost, remember to use ‘PJG’ as the promo code – it will give you a $80 discount on the first bill.
September 25th, 2005 at 11:07 am
jarv -> You might want to check SCGI. It’s supposedly very fast & easy to install (both on Win/*nix).
September 27th, 2005 at 7:19 am
Rake gem failing – “SSL is not installed on this system”
It seems this has caused issues for several people. This issue can occurs unless you have Ruby’s openssl bindings.
To see a detailed explanation about installing rails on Ubuntu, go to Rail’s wiki and Paul Goscicki’s blog.
October 4th, 2005 at 7:17 pm
Check out the libgems-ruby1.8 and rubygems packages from this site:
http://www.sgtpepper.net/hyspro/deb/unstable/
Here’s from the README.Debian:
–
Gems which Debian’s RubyGems will install are stored at /var/lib/gems instead
of /usr/lib/ruby/gems. Executables of the gems will be put at
/var/lib/gems/1.8/bin (for Ruby 1.8). In order to use them you manually have to
add the directory in your PATH environment variable or make symbolic links at
/usr/bin.
–
It’s a really nice solution. You get package management for the core portion of
rubygems and all of the locally installed gems go into /var/lib/gems, so they don’t
touch /usr and leave files there that the Debian packages don’t know about.
The only pain is creating the symlink for shell scripts, but all in all, not too much of
a hassle.
October 4th, 2005 at 9:56 pm
Blair -> Sounds interesting. I will have to take a closer look at it.
October 5th, 2005 at 8:58 am
apt-get install libmysqlclient14-dev. i would like to install this library how i can do this.becz i m new on linux.
if any guy can help then i’ll be thankful
arshad
October 6th, 2005 at 1:23 pm
arshad -> Uhm. I’d start with installing Ubuntu/Debian.
October 12th, 2005 at 9:08 am
Can’t get the mysql gem to install… error is:
extconf.rb:1:in `require’: no such file to load — mkmf (LoadError)
from extconf.rb:1
ERROR: While executing gem … (RuntimeError)
ERROR: Failed to build gem native extension.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.6 for inspection.
ruby extconf.rb install mysql\n
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.6/gem_make.out
Installed GCC and mysql development libraries…no luck.
October 12th, 2005 at 5:54 pm
Sean -> I believe you need to install
ruby1.8-dev(mentioned in one of the first steps).November 3rd, 2005 at 2:12 am
Paul, I wish I had found this a couple months ago!
What is the reasoning behind including rails in the apt-get install, removing it and then getting it through gems? I guess by including it there several dependencies are installed. Thanks.
November 3rd, 2005 at 11:34 pm
vinbarnes -> Yes, that’s the point – you install first the required dependencies (for rails to run) and them remove it to install it more properly (imo) via ruby gems. Installing it this way has one big advantage over getting it through the apt repository – you get new rails versions the moment they are released, without waiting for someone to create the .deb packages.
March 23rd, 2006 at 12:40 pm
Brilliant guide – rails is working now (in dapper)!
Many thanks
April 28th, 2006 at 11:21 pm
to Blair Zajac, you could also just pass some options to setup to achieve the same effect(see ./setup.rb –help)
May 3rd, 2006 at 10:18 am
[...] Paul Goscicki » Blog Archive » Installing Ruby on Rails on Ubuntu 5.04 (Hoary) (tags: rails ubuntu ruby linux howto rubyonrails mysql) [...]
June 15th, 2006 at 4:52 pm
[...] RailsOnUbuntuDebianTestingAndUnstable Ubuntu, Rails, Typo and Apache2 Installing Ruby on Rails on Ubuntu 5.04 (Hoary) Instalación de Rails en Ubuntu 5.10 (Breezy) Elias Torres: My Ubuntu [...]
June 16th, 2006 at 1:30 pm
Paul, I gotta say that this saved me a lot of time and hairloss.
I’ve got it up and running following your instructions. BTW, this is on a Dapper 6.06 system. The only change I had to make was replace your addition to soruces.list’ “hoary-” with “dapper-”
Not bad!
And I am extremely grateful!
-Roger A
June 16th, 2006 at 4:07 pm
June 22nd, 2006 at 5:28 pm
[...] Installing Ruby on Rails on Ubuntu [...]
June 24th, 2006 at 11:42 pm
This worked perfectly on a new install of Dapper. Thank you!
July 1st, 2006 at 6:02 am
To keep the thread on the cutting edge – the libgems-ruby package hit Debian’s experimental, and thus this is most probably the best place to get it.
July 1st, 2006 at 11:55 pm
I was unable to get any of the mysql gems to work (on dapper). they all produced a “MySQL::Error: Lost connection to MySQL server during query:” failure.
What finally did it for me was
apt-get install libmysql-ruby1.8
(that, and adding a socket: line to database.yml to point the /var/run/mysqld/mysqld.sock)
July 4th, 2006 at 2:25 am
[...] Paul Goscicki » Blog Archive » Installing Ruby on Rails on Ubuntu 5.04 (Hoary) (tags: ruby ubuntu) [...]
July 6th, 2006 at 3:29 pm
Great tutorial. Had one problem though. Whenever I run a gem command I get:
ERROR: While executing gem … (Gem::GemNotFoundException)
Could not find rubygems-update (> 0) in the repository
or, could not find rails, or rake, etc.
gem –version yields 0.9.0
July 8th, 2006 at 2:27 am
cptvitamin:
I had the rubygems error as well, reinstalling rubygems 0.8.11 (with `ruby setup.rb`) worked for me. I haven’t looked into why 0.9.0 gave the error.
July 10th, 2006 at 7:43 pm
I have the same problem as cptvitamin
ERROR: While executing gem … (Gem::GemNotFoundException)
Could not find rubygems-update (> 0) in the repository
I only get this error when running:
sudo gem install rails or sudo gem update –system
if I dont use sudo I get
permission denied /usr/lib/ruby/***
I had to sudo to do any of the apt-get stuff should I have not been sudo when untarting and running ruby setup.rb ???
Any thoughts, ideas?
July 10th, 2006 at 8:22 pm
Oh yeah this is on Ubuntu 6.06 and I have tried a bunch of different tutorials from the web.
July 10th, 2006 at 8:30 pm
OK got it working cptvitamin,
I did everything the same, but now I run:
“gem update” NOT “gem update –system”
I don’t know why but it doens’t like that system
July 13th, 2006 at 3:39 pm
cptvitamin, tim, dan: read this.
July 22nd, 2006 at 5:24 pm
This tutorial isn’t working for me at all on Dapper Ubuntu 6.06. Any ideas would be appreciated!
Here’s what I get:
I added the line the my sources.list and when I update is only pulls down 14Bytes from each of the backports, so I think this may be the problem…
Get:16 http://archive.ubuntu.com dapper-backports/main Packages [14B]
Get:17 http://archive.ubuntu.com dapper-backports/restricted Packages [14B]
Get:18 http://archive.ubuntu.com dapper-backports/universe Packages [14B]
Get:19 http://archive.ubuntu.com dapper-backports/multiverse Packages [14B]
Fetched 204kB in 2s (68.6kB/s)
Reading package lists… Done
So then I try to install (excerpts):
un@host:~$ sudo apt-get install rails irb ri1.8 ruby1.8-dev
E: Couldn’t find package rails
un@host:~$ sudo apt-get install irb ri1.8 ruby1.8-dev
E: Couldn’t find package irb
un@host:~$ sudo apt-get install ri1.8 ruby1.8-dev
Package ri1.8 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package ri1.8 has no installation candidate
un@host:~$ sudo apt-get install ruby1.8-dev
The following extra packages will be installed:
libruby1.8
Recommended packages:
ruby1.8
The following NEW packages will be installed:
libruby1.8 ruby1.8-dev
July 22nd, 2006 at 5:36 pm
Fixed it!
The source.list line in this tutorial didn’t work for me, but when I added:
deb http://us.archive.ubuntu.com/ubuntu dapper universe
deb-src http://us.archive.ubuntu.com/ubuntu dapper universe
I was able to install all the required packages! Thanks!
August 22nd, 2006 at 7:29 pm
Fought with this installation for hours, then i found this post. Thanks for the tutorial , worked great !!
September 20th, 2006 at 9:38 pm
[...] If you’re using windows, try the article from All About Ruby for step by step intall: Installing Rails on Windows If you’re using linux, try the article from Paul Goscicki for step by step install: Installing Ruby on Rails on Ubuntu [...]
November 29th, 2006 at 9:26 pm
Still not working for me. I followed the directions which seemed to go just fine. I have my app working fine with Webrick. Apache2 on Dapper with fcgi – no dice. When I run ruby -d public/dispatch.fcgi I see I fail doing a require openssl in gem_openssl.rb. I have installed the openssl package described above – am I missing something else? I’ve tried to install many other base system openssl libraries and development headers, etc. Still doesn’t work.
I tried uncommenting the !/…/ruby in the dispatch.fcgi and got different errors.. Not sure if those are valid or not.
December 7th, 2006 at 9:07 pm
Brian -> Although I feel for you, I’m not sure I can help you. I am only able to recommend two things. First and foremost drop the FCGI altogether (it’s currently being regarded as utter crap) and go straight for Mongrel. If that does not work you could always try reinstalling the whole OS. And btw, that #!/usr/bin/ruby is not a comment it’s a required line for the script to work (it tells the shell which app to use to execute the script).
December 11th, 2006 at 5:42 pm
Your script fails:
# gem update –system
Updating RubyGems…
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR: While executing gem … (URI::InvalidURIError)
bad URI(is not URI?): ://:
#
December 11th, 2006 at 6:11 pm
Nigel Horne: I believe it might be related to your network settings or that the RubyForge is down.
December 21st, 2006 at 11:20 pm
Paul – your tutorial was great help. I’m sure I would have never done it without you. Thanks! cj
January 24th, 2007 at 9:26 am
[...] If you get this when trying to install rails with rubygem you apparently need to remove your source cache. [...]
February 8th, 2007 at 6:16 am
while giving the command
apt-get install ruby ri rdoc irb ri1.8 ruby1.8-dev libzlib-ruby
i got the message as
The following packages have unmet dependencies:
irb: Depends: irb1.8 but it is not going to be installed
rdoc: Depends: rdoc1.8 but it is not going to be installed
ri1.8: Depends: rdoc1.8 (= 1.8.4-1ubuntu1) but it is not going to be installed
E: Broken packages
what can I do?
February 8th, 2007 at 6:28 am
Paul – I have also the same problem as Mr.Prijesh
How can I install ruby on rails in ubuntu breezy .
Pls give a remedy for this….
February 8th, 2007 at 11:21 am
Prijesh, Abhilash -> Try installing each package separately instead of all in one line. You could also try installing just “ri” instead of “ri1.8″. Also, try running
apt-get clean. Oh, and try googling for “depends but it is not going to be installed”. And you could try “apt-get update && apt-get upgrade” too.February 8th, 2007 at 12:17 pm
[...] http://paulgoscicki.com/archives/2005/09/ruby-on-rails-on-ubuntu/ [...]
February 9th, 2007 at 5:05 pm
Paul – Thanks for the great tips!
I wish I had find this before I set up RoR and fail…
http://localhost:3000/admin
is not working for me.
I’m new to both linux and RoR but trying to learn both.
After the installation, how could I know RoR is running on my Ubuntu Edgy?
February 9th, 2007 at 6:13 pm
Uhm, it goes like this:
With the last command executed in another console.
February 19th, 2007 at 11:11 am
[...] http://paulgoscicki.com/archives/2005/09/ruby-on-rails-on-ubuntu/ [...]
February 19th, 2007 at 11:16 am
Paul, when I running command ‘ruby setup.rb’ I got it as
[root@abhilash rubygems-0.9.2]# ruby setup.rb
—> bin
lib
—> lib/rbconfig
lib/rubygems
bin
lib
—> lib/rbconfig
lib/rubygems
bin
mkdir -p /usr/local/bin/
install gem /usr/local/bin/
install gem_mirror /usr/local/bin/
install gem_server /usr/local/bin/
install gemlock /usr/local/bin/
install gemri /usr/local/bin/
install gemwhich /usr/local/bin/
install index_gem_repository.rb /usr/local/bin/
install update_rubygems /usr/local/bin/
lib
mkdir -p /usr/local/lib/ruby/site_ruby/1.8/
install gemconfigure.rb /usr/local/lib/ruby/site_ruby/1.8/
install rubygems.rb /usr/local/lib/ruby/site_ruby/1.8/
install ubygems.rb /usr/local/lib/ruby/site_ruby/1.8/
—> lib/rbconfig
mkdir -p /usr/local/lib/ruby/site_ruby/1.8/rbconfig
install datadir.rb /usr/local/lib/ruby/site_ruby/1.8/rbconfig
lib/rubygems
mkdir -p /usr/local/lib/ruby/site_ruby/1.8/rubygems
install builder.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install cmd_manager.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install command.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install config_file.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install custom_require.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install dependency_list.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install doc_manager.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install format.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install gem_commands.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install gem_open_uri.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install gem_openssl.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install gem_runner.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install installer.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install old_format.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install open-uri.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install package.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install remote_fetcher.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install remote_installer.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install rubygems_version.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install security.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install server.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install source_index.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install source_info_cache.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install source_info_cache_entry.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install specification.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install timer.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install user_interaction.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install validator.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
install version.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems
0) in any repository
Pls give a solution to install ruby on rails in redhat linux.
February 19th, 2007 at 6:45 pm
RedHat? Uhm, I’d rather google it. I stay away as far as possible from anything rpm related .) Now as for the error it just might be that the Ruby gems repository was down. Or it may be something completely different.
February 20th, 2007 at 10:24 am
Paul , I hav installed Ruby on Rails using command gem install -y rails in ubuntu.
After that what wil I do?
How can I run Ruby on Rails.
Pls give the procedure to run ruby.
February 20th, 2007 at 12:34 pm
prijesh -> Uhm, have you actually read the guide above? It’s plain and simple, you just need to follow each step carefully.
February 20th, 2007 at 1:00 pm
Paul , actually I want to install ‘ postgresql ‘ and apache2 webserver.
How can I install & run both postgresql & apache2 webserver.
Then How can I test Rails & write programs in it?
February 20th, 2007 at 1:11 pm
It is out of the scope of this tutorial. But… for apache2 and postgresql just do
apt-get install apache2 postgresqland as for writing Rails applications Rails wiki is a good place to start.February 26th, 2007 at 7:25 am
Hai Paul.
Do u know how to change the core Rails validation error messages using plugins?
Or do u know any site that give me answer in brief ?
Pls reply me…
February 26th, 2007 at 11:44 am
Uhm, try google. Check the wiki too.
February 28th, 2007 at 3:39 am
I’m getting errors trying to ‘apt-get’ some packages on Ubuntu 6.10.
‘apt-get install ruby’ worked flawlessly, and I was able to run ‘ruby’.
Next, when I tried ‘apt-get install ri’, i get the following error:
The following packages have unmet dependencies:
ri: Depends: ri1.8 but it is not going to be installed
And then I tried: ‘apt-get install ri1.8′, and it asks me to get rdoc1.8, which gets me this error:
The following packages have unmet dependencies:
rdoc1.8: Depends: ruby1.8 (>= 1.8.4-5ubuntu1.2) but 1.8.4-5ubuntu1 is to be installed
Depends: irb1.8 (>= 1.8.4-5ubuntu1.2) but it is not going to be installed
Depends: libruby1.8 (>= 1.8.4-5ubuntu1.2) but 1.8.4-5ubuntu1 is to be installed
—-
When i tried to get librub1.8, it says it is already installed.
Something’s wrong with the dependency naming or version naming. Has anybody else encountered this?
March 18th, 2007 at 7:09 am
[...] it wouldn’t do what I told it to do) and with the help of Paul Goscicki and his article Ruby on Rails on Ubuntu I set up my Rails environment and started coding the demo app from my book. Damn, it’s so [...]
March 20th, 2007 at 11:04 pm
There is one more thing. I must install also libc6-dev – for C header files. Make calls gcc, and it needs this files.
March 21st, 2007 at 11:57 am
amorfis: libc6-dev is usually installed by default at some point (either as a dependency or during OS installation), but I’ll add it to the tutorial. Just in case.
March 23rd, 2007 at 12:35 am
when i try to install mongrel i get:
Building native extensions. This could take a while…
Successfully installed mongrel-1.0.1
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’: no such file to load — rdoc/rdoc (LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
from /usr/local/lib/site_ruby/1.8/rubygems/doc_manager.rb:71:in `load_rdoc’
from /usr/local/lib/site_ruby/1.8/rubygems/doc_manager.rb:41:in `generate_ri’
from /usr/local/lib/site_ruby/1.8/rubygems/gem_commands.rb:302:in `execute’
from /usr/local/lib/site_ruby/1.8/rubygems/gem_commands.rb:301:in `execute’
from /usr/local/lib/site_ruby/1.8/rubygems/gem_commands.rb:239:in `execute’
from /usr/local/lib/site_ruby/1.8/rubygems/command.rb:70:in `invoke’
from /usr/local/lib/site_ruby/1.8/rubygems/cmd_manager.rb:120:in `process_args’
from /usr/local/lib/site_ruby/1.8/rubygems/cmd_manager.rb:91:in `run’
from /usr/local/lib/site_ruby/1.8/rubygems/gem_runner.rb:30:in `run’
from /usr/bin/gem:23
heeeeeeeeeeeeeeeeeeeeelp!
March 23rd, 2007 at 10:46 am
/usr/local? Sorry, can’t help you. I bet 100:1 that your Ruby installation is just hosed. If you are on ubuntu (somehow I doubt that), just follow my guide and it will work just fine.
March 28th, 2007 at 3:12 am
I’m running Ubuntu 6.10 and have ruby 1.8.4 installed.
I’ve got rails too and just did “gem update –system” yet I have no “irb” on they system…what’s up with that?
Thanks,
/Ed
March 28th, 2007 at 8:07 pm
Ed Arthur -> You can either follow my guide or just run
apt-get install irb.March 29th, 2007 at 1:13 am
Right, its the apt-get which fails.
% sudo apt-get install irb
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Couldn’t find package irb
%
I’m more of a command line kind of guy but I’ve been using the (Syanptic Package Manager) GUI mainly to install packages on this Ubuntu system.
I don’t have the “Community maintained Ope Source software or Software restricted by copyright or legal issues boxes checked.
Thanks,
/Ed
March 29th, 2007 at 8:25 pm
Ed Arhur -> You need to have universe repositories enabled. Edit your
/etc/apt/sources.listto include this line:I’ve updated the guide to reflect this.
March 30th, 2007 at 2:22 am
That did it thanks.
April 11th, 2007 at 2:10 am
[...] 11th, 2007 Handy tutorial by Paul Goscicki to get Ruby on Rails installed on Ubuntu. It doesn’t cover installation of MySql or Apache (installed already on my [...]
April 24th, 2007 at 12:59 am
Than you so much for this tutorial after hours of unsuccessfully trying to set-up ruby on rails on feisty fawn. I finally managed to do it thanks to this tutorial.
April 29th, 2007 at 6:32 am
Thanks for a great tutorial. Working ~ Feisty Fawn
July 3rd, 2007 at 8:23 pm
Thank you so much for a very simple easy-to-follow tutorial on setting up Rails on Ubuntu.
I have been so tired of using Windows XP that this weekend I managed to setup a dual boot system with my current Windows XP install and my new favorite operating system Ubuntu.
I used this great tutorial => http://www.linuxdevcenter.com/pub/a/linux/2006/05/08/dual-boot-laptop.html
to get my dual boot system up and running and then I used your tutorial here to get my ROR up and running.
Everything worked according to plan and today I am back coding in Ruby on Rails in my Linux environment.
Thanks a bunch! You saved me tons of time.
For the rest of you…
If you are still using Windows, I suggest you take a look at Ubuntu it is fairly easy to install if you can follow directions.
You won’t be disapointed with this OS and hos much faster and friendlier it is to use.
http://www.ubuntu.com/
Cheers
http://www.freshnames.biz
August 11th, 2007 at 2:19 am
Works like a charm. It seems that that gem update –system command can make a problem if you forget to execute as super user.
These are the most useful instructions that work on XUbuntu dapper.
October 10th, 2008 at 9:15 pm
First I apologize my poor English.
After to install the ruby 1.8.7 patch level 22 from the source
on ubuntu 8.04 hardy succefully.
Then I tryed to install rubygems 1.2 in sequence and I
received this error message:
xyz@xyz: /usr/local/src/rubygems-1.2.0$ sudo ruby setup.rb
/lib/rubygems/spec_fetcher.rb:1:in `require’: no such file to load –
zlib (LoadError)
So I tried install zlib1g and zlib1g-dev and after this the problem has not fixed
And I didn’t unistall ruby for reinstall and recompile…
I tried many kind of commands like for uninstall and re-compile ruby:
sudo apt-get remove ruby libruby libruby1.8 ruby1.8 irb rdoc ri
sudo aptitude remove ruby
sudo dpkg –list | grep ruby, dpkg -r
and through Synaptic too
And when I invoke ruby -v or irb, these commands works normally…
How Can I fix this problem?
Thank’s so much for help me!
Bruno