Getting Ruby and Rails working on Ubuntu Intrepid

10:49 pm

Installing Ruby on rails isn’t yet perfected using Ubuntu apt-get.

Instead: install Ruby from apt-get but download/install RubyGems from source.  This will avoid conflicts between apt-get and gem.

Install Ruby from apt-get.
$ sudo apt-get install ruby irb ri rdoc ruby1.8-dev libzlib-ruby libyaml-ruby libreadline-ruby libncurses-ruby libcurses-ruby libruby libruby-extras libfcgi-ruby1.8 build-essential libopenssl-ruby libdbm-ruby libdbi-ruby libdbd-sqlite3-ruby sqlite3 libsqlite3-dev libsqlite3-ruby libxml-ruby libxml2-dev

Download the latest RubyGems (currently 1.3.1) from rubyforge:

cd rubygems-1.3.1
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
sudo gem update –system
sudo gem install rails
sudo apt-get install build-essential ruby1.8-dev
sudo gem install mongrel
sudo apt-get install mysql-server mysql-client mysql-admin mysql-query-browser libmysqlclient15-dev  libdbd-mysql-ruby
sudo gem install mysql
sudo apt-get install sqlite3 swig libsqlite3-ruby libsqlite3-dev
sudo gem install sqlite3-ruby
echo “export RUBYOPT=rubygems” >> ~/.profile

rails path/to/your/app

(or rails path/to/your/app -d mysql to set app up to use MySQL for database operations)

Bookmark and Share
Ubuntu, Web/Tech
Related posts:
  • dfsdfs
    Thank you VERY MUCH!
  • Padmanabham Mishra
    you really made my day, I was trying to get thing running for past 3 days, I will recommend to all my friends. Its essential to read this post before starting to setup rails development environment.
  • manjunathpuru
    excellent answer......thank you very much........
  • neiluJ
    you made my day !
    thanks a lot !
  • Katori Hudato
    great job, I've trouble with firewatir ( http://wiki.openqa.org/display/WTR/Install+Watir ) but a lot of ruby-derived-problems has been solved with your help.

  • I tried this and now I am getting the following at the prompt:

    user@user:~/rubygems-1.3.3$ gem ver
    /usr/bin/gem:10: undefined method `manage_gems' for Gem:Module (NoMethodError)

  • Dierk
    Did you do the following as mentioned above?
    sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

    That solved the problem for me.
  • Aldo
    Gracias.
  • Fisa
    THANKS!!!!!

    After 2 days trying to get rails working on pubuntu (portable ubuntu), finally works.

    Fisa - Juan Pedro Fisanotti
blog comments powered by Disqus