Dapper is a few weeks behind in integrating the RoR v1.1 Debian package. Only 1.o is available at the moment, but 1.1 should be available in the final relase of Dapper, so in a few weeks you’ll only need to ‘apt-get install rails’.
For now, I’ll use rubygems to install RoR. First, you need to have Ruby installed:
sudo apt-get install ruby
Next, following the download instructions on rubyonrails.org: wget the rubygems software, install it, use it to install rails.
wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
tar -zxvf rubygems-0.8.11.tgz
cd rubygems-0.8.11.tgz
sudo ruby setup.rb
sudo gem install rails --include-dependencies
rails path/to/your/new/application
cd path/to/your/new/application
ruby script/server
I put my app in ~/src/app1 for now. Next, open the provided url in your browser and follow the instructions there. I want to use PostgreSQL as my database backend. I also want to use subversion for revision control. Each one requires a bit of extra setup.
sudo apt-get install postgresql-8.1 subversion
sudo gem install postgres-pr
Instructions for setting up PostgreSQL can be found in /usr/share/doc/postgresql-8.1/README.Debian.gz. I will create a PSQL user with the same username as my account, and make the dbs for the app1. It might be a good idea to also set a password for the databases, but I won’t do it. Lastly, modify the database.yml file with the appropriate adapter: postgresql and user: alex.
sudo -u postgres sh
createuser -DRS alex
createdb -O alex app1_development
createdb -O alex app1_test
createdb -O alex app1_production
exit
vi ~/src/app1/config/database.yml
I’ll make the subversion repository in my home directory with instructions from /usr/share/doc/subversion/README.gz. We blow away the original code after import, which isn’t very safe. It’s ok in this case because our app can be regenerated with a couple of commands.
less /usr/share/doc/subversion/README.gz
svnadmin create ~/app1svnrepo
cd ~/src/
mv app1 trunk
mkdir app1
mv trunk/* app1/trunk
mkdir app1/branches
mkdir app1/tags
cd
svn import ~/src/app1 file:///home/alex/app1svnrepo -m "Initial import"
rm -r ~/src/app1
cd src
svn checkout file:///home/alex/app1svnrepo/ app1
Now you can work on creating your app.