Ruby   WPI Rails HOWTO   Rails


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

  1. cd
  2. mkdir ruby
  3. wget http://rubyforge.org/frs/download.php/7858/ruby-1.8.4.tar.gz
  4. tar xzvf ruby-1.8.4.tar.gz
  5. cd ruby-1.8.4
  6. ./configure --prefix=/home/username/ruby

    Replace username with your CCC unix username.

  7. make
  8. make install
  9. echo "export PATH=~/ruby/bin:$PATH" >> ~/.bash_profile

    Or comparable action, if you're using a shell other than bash.

  10. export PATH=~/ruby/bin:$PATH

    Or comparable action, if you're using a shell other than bash.

  11. cd
  12. ruby --version

    Should report: ruby 1.8.4 (2005-12-24) [i686-linux]

Install RubyGems

  1. wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
  2. tar xzvf rubygems-0.8.11.tgz
  3. cd rubygems-0.8.11
  4. ruby setup.rb

Install Rails

  1. gem install rails --include-dependencies

Create WPI MySQL database

  1. https://www.wpi.edu/Academics/CCC/Services/Databases/MySQL.html

Create Rails environment

  1. cd ~/public_html/
  2. 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.

  3. rails rails

    The second 'rails' can be anything you want (but remember what you call it).

  4. cd rails/public
  5. chmod -R o+r ./
  6. chmod o+x ./ images javascripts stylesheets
  7. Open .htaccess in your favorite text editor
  8. Comment out line 4: #Options +FollowSymLinks +ExecCGI
  9. Uncomment line 27: RewriteBase /~username/rails/public
  10. Save and close .htaccess
  11. cd ../config
  12. Open database.yml in your favorite text editor
  13. Change the database: values to the name of the database you created
  14. Change the username: values to your MySQL username
  15. Change the password: values to your MySQL password
  16. Change the host: values to mysql.wpi.edu
  17. Save and close database.yml

That's all, Folks!

Load up http://users.wpi.edu/~username/rails/public

Valid HTML 4.01 Transitional Valid CSS!