This guide is not designed to give any sort of comprehensive description of "why" -- it is just a laundry list of how I managed to get Rails to work in my WPI webspace. It is very specific to WPI, and there are much easier ways to make it work on a server that you control. That said, if you follow this, you should be able to get Rails up and running without needing your own server.
Compile local Ruby environment
- cd
- mkdir ruby
- wget http://rubyforge.org/frs/download.php/7858/ruby-1.8.4.tar.gz
- tar xzvf ruby-1.8.4.tar.gz
- cd ruby-1.8.4
-
./configure --prefix=/home/username/ruby
Replace username with your CCC unix username.
- make
- make install
-
echo "export PATH=~/ruby/bin:$PATH" >> ~/.bash_profile
Or comparable action, if you're using a shell other than bash.
-
export PATH=~/ruby/bin:$PATH
Or comparable action, if you're using a shell other than bash.
- cd
-
ruby --version
Should report: ruby 1.8.4 (2005-12-24) [i686-linux]
Install RubyGems
- wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
- tar xzvf rubygems-0.8.11.tgz
- cd rubygems-0.8.11
- ruby setup.rb
Install Rails
- gem install rails --include-dependencies
Create WPI MySQL database
- https://www.wpi.edu/Academics/CCC/Services/Databases/MySQL.html
Create Rails environment
- cd ~/public_html/
-
umask 0027
Good security measure... will be a pain when we have to manually chmod a bunch of files, but prevents people from grabbing your MySQL password or digging around in your code.
-
rails rails
The second 'rails' can be anything you want (but remember what you call it).
- cd rails/public
- chmod -R o+r ./
- chmod o+x ./ images javascripts stylesheets
- Open .htaccess in your favorite text editor
- Comment out line 4: #Options +FollowSymLinks +ExecCGI
- Uncomment line 27: RewriteBase /~username/rails/public
- Save and close .htaccess
- cd ../config
- Open database.yml in your favorite text editor
- Change the database: values to the name of the database you created
- Change the username: values to your MySQL username
- Change the password: values to your MySQL password
- Change the host: values to mysql.wpi.edu
- Save and close database.yml
That's all, Folks!
Load up http://users.wpi.edu/~
username/rails/public