Archive for Installing Rails on Fedora

Installing Ruby on Rails on Fedora 7

Note:

Plan of Attack

This is a quick down and dirty guide to getting Ruby and Rails working in Fedora 7. You may notice this is installed into /tmp File, I do this because its universal on all Fedora and Linux distributions.

  • Install Ruby
  • Install RubyGems via source
  • Install Ruby on Rails using RubyGems
  • Test Rails installation

  • Certain commands need to be executed as root. Lines requiring to be run as root, begin with a hash (#). To enter root execute su - Terminal.
  • If a line begins with a dollar sign ($), those can be run as a normal user.
  • If a line begins with a hash or a dollar sign, do not enter the starting hash or dollar sign into the terminal

Install Ruby

$ su -
# yum install ruby ruby-rdoc ruby-irb

If you get an error, similar to the following, just wait a while and try the above command again.
Loading "installonlyn" plugin
Existing lock /var/run/yum.pid: another copy is running as pid 2321. Aborting.

If you get something similar to the following, just enter y.
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Importing GPG key 0x4F2A6FD2 "Fedora Project " from /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
Is this ok [y/N]:

Install RubyGems via source

Note: Latest version of RubyGems (0.9.4) as of 10th June 2007.
Enter into the Terminal:

cd /tmp
wget http://rubyforge.org/frs/download.php/20989/rubygems-0.9.4.tgz
tar -zxvf rubygems-0.9.4.tgz
cd rubygems-0.9.4
# ruby setup.rb

Install Ruby on Rails using RubyGems

Enter into the Terminal:
# gem install -y rails
Note: If it fails, try executing # gem update Terminal and then execute the command above again.

Test Rails installation

Enter into the Terminal:

rails /tmp/railstest
cd /tmp/railstest
./script/server

Open up Firefox and go to http://localhost:3000, a page should show up indicating a successful installation. Your basically good to go with the minor exception of a database connection.

After…

Generally you’d want some sort of database connection, with the three standards choices being.

  • SQLite:
    If you just want to experiment with Ruby on Rails, I’d recommend using SQLite.
  • MySQL
  • PostgreSQL

Stay tuned!

Comments (1)