Topic: HOWTO: Install Ruby on Rails on Ubuntu Linux
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:
Are to be run in a terminal/command prompt window, unless otherwise noted.
1. Log in and open a terminal if you need to. First we'll install Ruby 1.8 and Ruby's development libraries. We'll also install IRB, which is quite useful while trying Ruby programming.
sudo apt-get install ruby ruby1.8-dev irb
You will be prompted for your password so be sure to get it right!
2. Now that Ruby's installed, let's install SQLite 3. SQLite is a lightweight, file-based database that's good for development. Feel free to use another database here if you'd like, such as MySQL or PostgreSQL.
sudo apt-get install sqlite3
3. Now let's start installing Rails. First you'll need RubyGems. Download it this way:
4. Now unpack the RubyGems package:
tar -zxvf rubygems-0.8.11.tgz
5. Now go into the directory created from unpacking, and run the setup program:
sudo ruby setup.rb
6. Now we have RubyGems installed, so we can install Rails and friends.
sudo gem install rails --include-dependencies
This will install the latest version of Rails (1.1.4 as of this writing).
7.OPTIONAL: Install Mongrel, the fast server for Rails:
sudo apt-get install build-essential
sudo gem install mongrel --include-dependencies
8. Create a test Rails app somewhere
9.Run your newly created Rails app to see if everything is working:
If you installed Mongrel, do this:
mongrel_rails start -d
If you didn't install Mongrel, do this:
10. Go to http://localhost:3000 in your browser. Congratulations, you're on Rails!
NOTE FOR MONGREL USERS: Edge Rails (the version of Ruby on Rails that is under active development) now has support for running Mongrel through script/server if you have it installed. All you will have to run then is
The script will start Mongrel instead of WEBrick if found.
Good luck with your install, and post any questions you may have here.