How to install Rails 2.3 Edge on DreamHost

DreamHost is one of the best (cheap 'n' realiable) Hosting for Rails. It offers a lot of services SSH, Mysql, Backup,... (like Site5) but the Rails support is better because you can choose among different technologies: Fcgi(deprecated), Passenger/mod_rails and Webrick(just for test), Mongrel.

Currently the gem installed is Rails 2.2.2, but you have a shell so you can choose (in Theory) whatever Rails version you like.

Some errors you could encounter. Happy DEBUG-gin'!

Manage (ruby)gems by yourself

Managed Hosting are nice because are cheaper than VPN/Virtual Servers, but they manage your environment and this is not good. A bad automatized update could break your apps and to control the dependencies is alwais the best choice.

The gems already present will be used but the priority is on the gems you choose to install in your $HOME.
Here how to setup the Enviroment.

# This is ~/.bash_profile
umask 002
PS1='[\h]$ '
# Added by me
source ~/.bashrc

# This is ~/.bashrc
export PATH="$HOME/.gemlocal/bin:${PATH}"
export GEM_HOME=$HOME/.gemlocal
export GEM_PATH="$GEM_HOME"

# This is ~/.gemrc
gemhome: /home/your-username/.gemlocal
gempath:
- /home/your-username/.gemlocal
- /usr/lib/ruby/gems/1.8
gem: --no-rdoc --no-ri

Re-login and execute:

mkdir ~/.gemlocal
gem install rack --source http://chneukirchen.org/releases/gems/
gem install sqlite3-ruby
gem install rails --version 2.3.0 --source=http://gems.rubyonrails.org

Check the output of "rails -v" and "which rails"

Setup the Domain with Passenger/Rack/Apache

Passenger is a smart webserver and it scales well.

Go to the DH Panel(Domains > Manage Domains) and setup a new domain that points to "/home/your-username/rails-app/public" and don't forget to enable the mod_rails and disable FastCGI.

rails rails-app

..and Congratulations! You should see this Welcome message.

Conclusion and debugging

Remember that You can obtain the "development" mode forcing ENV['RAILS_ENV'] = 'development' in config/environment.rb, very useful to understand what happens, and you can restart the server with "touch tmp/restart.txt" in your rails-app folder.

That's all.

 

PS: If you need a PROMO CODE to subscribe to DreamHost, the code: WHATZAMERICA gives to you the 60$ of discont on every yearly plan.

 

commenti

Rails 2.3 is incompatible with Dreamhost's old Passenger

Dreamhost forum thread
Any solution for that? Or is it normally not an issue?

Dreamhost and Rails 2.3

It depends, You can't update Passenger by yourself in DH shared hosting. I had some problems but if you follow my guide You should get a working Rails 2.3 base on DreamHost.

Ruby 1.9

Ciao sono quello che ti aveva chiesto del supporto a rails nel tuo post precedente. Volevo informarti che da qualche giorno sono anche io un felice cliente di Dreamhost (ho utilizzato il promo code).
Tornando all'articolo credo che la cosa veramente interessante sarebbe avere ruby 1.9.1 con il rispettivo rails cosa che comporterebbe non pochi benefici almeno in termini di performance (vedi YARV). Purtroppo credo che si dovrà aspettare ancora del tempo prima del passaggio alla nuova versione di ruby, in quanto molti gems rimangono ancora da "portare".

Why so complicated?

What's wrong with "rake rails:freeze:edge RELEASE=2.3.2"?

Does it work? If so, I'll

Does it work? If so, I'll certainly use it until Dreamhost upgrades to 2.3.

gem vs plugins

The "gem" is the smartest way to keep your vendor/ dir clean and more and more plugins are converting to this system.

O rly?

Just freeze it.