Aptana RadRails will prompt you to install any needed Ruby gems for users with Windows or Mac OS X operating systems. If you're on Ubuntu or Debian Linux, though, a few more manual steps are needed to get RadRails running smoothly. The instructions below give the commands that you'll need to use to install Ruby, Ruby Gems, Rails, and Mongrel as both a root and non-root user.
Note: Much of the information on this page originally appeared on the Ubuntu Community Documentation site: https://help.ubuntu.com/community/RubyOnRails
Contents |
Installing as root
Make sure that you have the Universe repository enabled in your /etc/sources.list. See https://wiki.ubuntu.com/AddingRepositoriesHowto for instructions.
In Ubuntu 6.06LTS or newer, you can install the "rails" package then skip to creating your first Rails app but this can cause some annoying issues with Ubuntu's package management (apt-get) and the Rails gem manager.
Installing Ruby
At the command line:
sudo apt-get install ruby rdoc irb libyaml-ruby libzlib-ruby ri libopenssl-ruby ruby1.8-dev
Installing Ruby Gems via source
Install the gem executable to /usr/bin/gem1.8:
wget http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz tar xzvf rubygems-1.0.1.tgz cd rubygems-1.0.1 sudo ruby setup.rb sudo gem update --system sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
Installing as a non-root user
You can install Rubygems in your home directory, which is possibly safer as it doesn't install or modify files outside of your home directory.
Installing Ruby
At the command line:
sudo apt-get install ruby rdoc irb libyaml-ruby libzlib-ruby ri libopenssl-ruby
Installing Ruby Gems
wget http://rubyforge.org/frs/download.php/17190/rubygems-0.9.2.tgz tar xzvf rubygems-0.9.2.tgz cd rubygems-0.9.2 PREFIX=$HOME export GEM_HOME=$PREFIX/lib/ruby/gems/1.8 export RUBYLIB=$PREFIX/local/lib/ruby:$PREFIX/local/lib/site_ruby/1.8 ruby setup.rb all --prefix=$PREFIX
Next, add GEM_HOME
and RUBYLIB
into your ~/.profile
file to automatically load on login (otherwise some scripts will not be
able to find rubygems).
Installing Rails and its dependencies
At your command line:
~/bin/gem install rails -y
Creating your first Rails application
You can create your first Rails application as the current user without using "sudo":
$ ~/lib/ruby/gems/1.8/bin/rails/path/to/new/railsapp
Replace /path/to/new/railsapp
with your own path to where you want your app source code to live (e.g.
/home/myhome/rails/myapp
.)
Installing Mongrel
At the command line:
sudo apt-get install build-essential sudo apt-get install ruby1.8-dev sudo gem install mongrel
Installing the MySQL gem
sudo apt-get install libmysqlclient15-dev sudo gem install mysql
Installing SQLite3
The instructions in this section originally appeared on the Plan A blog:
- Type the following on the command line to install SQLite:
sudo apt-get install sqlite3 libsqlite3-dev sudo gem install sqlite3-ruby
- Create a database by creating an empty file, using the following code:
touch database_name_dev.db touch database_name_test.db touch database_name_prod.db
- Configure the following files as described:
- development:
- adapter: sqlite3
- database: db/database_name_dev.db
- test:
- adapter: sqlite3
- database: db/database_name_test.db
- production:
- adapter: sqlite3
- database: db/database_name_prod.db
- development: