Installing Ruby on Rails on Ubuntu

This guide is valid for the following distributions:

Ruby on Rails

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!

75 Responses to “Installing Ruby on Rails on Ubuntu”

  1. jarv Says:

    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.

  2. Shot Says:

    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’…

  3. Paul Goscicki Says:

    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.

  4. Shot Says:

    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.

  5. jarv Says:

    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… ;]

  6. Paul Goscicki Says:

    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.

  7. Paul Goscicki Says:

    jarv -> You might want to check SCGI. It’s supposedly very fast & easy to install (both on Win/*nix).

  8. Free Opinion Says:

    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.

  9. Blair Zajac Says:

    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.

  10. Paul Goscicki Says:

    Blair -> Sounds interesting. I will have to take a closer look at it.

  11. arshad Says:

    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

  12. Paul Goscicki Says:

    arshad -> Uhm. I’d start with installing Ubuntu/Debian.

  13. Sean Maddox Says:

    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.

  14. Paul Goscicki Says:

    Sean -> I believe you need to install ruby1.8-dev (mentioned in one of the first steps).

  15. vinbarnes Says:

    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.

  16. Paul Goscicki Says:

    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.

  17. Rob Says:

    Brilliant guide – rails is working now (in dapper)!
    Many thanks

  18. capiCrimm Says:

    to Blair Zajac, you could also just pass some options to setup to achieve the same effect(see ./setup.rb –help)

  19. xtra’s blog » links for 2006-05-03 Says:

    [...] Paul Goscicki » Blog Archive » Installing Ruby on Rails on Ubuntu 5.04 (Hoary) (tags: rails ubuntu ruby linux howto rubyonrails mysql) [...]

  20. Accent français » Blog Archive » Installation de Ubuntu + Ruby on Rails + Lighttpd (lighty) - breezy ou dapper Says:

    [...] 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 [...]

  21. Roger Alterskjær Says:

    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

  22. Paul Goscicki Says:

    :) Thanks for the tip about the apt sources list – I’ve updated the guide to reflect this change.

  23. Passion is like genius; a miracle. » Installing Ruby on Rails on Ubuntu Says:

    [...] Installing Ruby on Rails on Ubuntu [...]

  24. John Allen Says:

    This worked perfectly on a new install of Dapper. Thank you!

  25. Shot Says:

    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.

  26. Dave Says:

    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)

  27. Like Your Work » Blog Archive » links for 2006-07-04 Says:

    [...] Paul Goscicki » Blog Archive » Installing Ruby on Rails on Ubuntu 5.04 (Hoary) (tags: ruby ubuntu) [...]

  28. cptvitamin Says:

    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

  29. Tim Says:

    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.

  30. dan Says:

    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?

  31. dan Says:

    Oh yeah this is on Ubuntu 6.06 and I have tried a bunch of different tutorials from the web.

  32. dan Says:

    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

  33. Paul Goscicki Says:

    cptvitamin, tim, dan: read this.

  34. Peter Boling Says:

    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

  35. Peter Boling Says:

    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!

  36. Corey Says:

    Fought with this installation for hours, then i found this post. Thanks for the tutorial , worked great !!

  37. Codemonster » A Southern Rubyist in the Land of Enterprise JAVA: Part 1 Says:

    [...] 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 [...]

  38. Brian Rowe Says:

    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.

  39. Paul Goscicki Says:

    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).

  40. Nigel Horne Says:

    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?): ://:
    #

  41. Paul Goscicki Says:

    Nigel Horne: I believe it might be related to your network settings or that the RubyForge is down.

  42. cj Says:

    Paul – your tutorial was great help. I’m sure I would have never done it without you. Thanks! cj

  43. Could not find rails (> 0) in the repository - Joakim Andersson Says:

    [...] If you get this when trying to install rails with rubygem you apparently need to remove your source cache. [...]

  44. Prijesh Says:

    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?

  45. Abhilash Says:

    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….

  46. Paul Goscicki Says:

    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.

  47. Ruby Brasil - » Ubuntu on Rails Says:

    [...] http://paulgoscicki.com/archives/2005/09/ruby-on-rails-on-ubuntu/ [...]

  48. Yuya Saito Says:

    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?

  49. Paul Goscicki Says:

    Uhm, it goes like this:

    rails test
    cd test/
    script/server
    lynx http://localhost:3000/
    

    With the last command executed in another console.

  50. Mike Howarth: Web Developer» Blog Archive » Ubuntu to the rescue Says:

    [...] http://paulgoscicki.com/archives/2005/09/ruby-on-rails-on-ubuntu/ [...]

  51. abhilash Says:

    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.

  52. Paul Goscicki Says:

    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.

  53. prijesh Says:

    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.

  54. Paul Goscicki Says:

    prijesh -> Uhm, have you actually read the guide above? It’s plain and simple, you just need to follow each step carefully.

  55. prijesh Says:

    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?

  56. Paul Goscicki Says:

    It is out of the scope of this tutorial. But… for apache2 and postgresql just do apt-get install apache2 postgresql and as for writing Rails applications Rails wiki is a good place to start.

  57. prijesh Says:

    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…

  58. Paul Goscicki Says:

    Uhm, try google. Check the wiki too.

  59. John of SearchAllDeals.com Says:

    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?

  60. onLINE » Clemens on Rails Says:

    [...] 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 [...]

  61. amorfis Says:

    There is one more thing. I must install also libc6-dev – for C header files. Make calls gcc, and it needs this files.

  62. Paul Goscicki Says:

    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.

  63. costa Says:

    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!

  64. Paul Goscicki Says:

    /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.

  65. Ed Arthur Says:

    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

  66. Paul Goscicki Says:

    Ed Arthur -> You can either follow my guide or just run apt-get install irb.

  67. Ed Arthur Says:

    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

  68. Paul Goscicki Says:

    Ed Arhur -> You need to have universe repositories enabled. Edit your /etc/apt/sources.list to include this line:

    deb http://archive.ubuntu.com/ubuntu edgy main restricted universe multiverse
    

    I’ve updated the guide to reflect this.

  69. Ed Arthur Says:

    That did it thanks.

  70. Installing Ruby on Rails on Ubuntu « Wave a dead chicken Says:

    [...] 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 [...]

  71. VJ Says:

    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.

  72. Olin Says:

    Thanks for a great tutorial. Working ~ Feisty Fawn

  73. Craig @ Freshnames.biz Says:

    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

  74. Vasil Vangelovski Says:

    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.

  75. Bruno Moura Says:

    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

Leave a Reply