Deployment

How to deploy a Ruby on Rails 2 application on GoDaddy

Unfortunately the Shared Hosting plans of GoDaddy.com didn't support Rails 2 so the only manner to use the new version of Ruby on Rails is to  freeze our application to the rails version we want to use.
I tried with rails 2.1.2 and the newest 2.2 but without any success; the only version I successfully installed is 2.0.5 and an example is my personal site www.matteotomasini.com.
This is the procedure I used to deploy Ruby on Rails 2.0.5 on GoDaddy.com

1. Platform setup
prepare your developer environment installing ruby and rails 2.0.5

2. Freeze gem
Create your new application and freeze it to the rails gem installed on your machine (2.0.5) with the command:
rake rails:freeze:gems

3. Replace gem occurrences with require_gem
because the ruby version installed on GoDaddy.com is very old in order to get our rails 2.0.5 working we need to substitute in vendor/rails/ files any occurrence of the call to the gem method with the older require_gem method

4. Files configuration
replace the fist line of dispatcher.rb dispatcher.cgi and dispacher.fcgi with:
#!/usr/local/bin/ruby
replace the gem version in the environment.rb configuration file to 1.1.6 and add the following line:
ENV['GEM_HOME'] = '/usr/local/lib/ruby/gems-dev/1.8'

5. Upload site to GoDaddy
Upload the site to your GoDaddy space with ftp and set files attribute of dispatcher.cgi and dispacher.fcgi to 755

The site is now available at the address:
http://www.yourdomain.com/your/application/path/public/

If you have any question email me at info@matteotomasini.com

Comments