Monday, August 24th, 2009

RubyGem version error: rack(0.3.0 not ~> 1.0.0)

Problem
Trying to deploy in dreamhost with capistrano you get the error:
RubyGem version error: rack(0.3.0 not ~> 1.0.0)
Solution
Log in with ssh to your dreamhost account and then install the newer version of rack that is not yet installed in dreamhost:
gem install rack
That assumes that you have followed the instructions for setting up your local gems [...]

No Comments » - Posted in Dreamhost, ruby on rails by kosmas

Wednesday, September 17th, 2008

Dreamhost, Rails 2.1.1, Freeze, Capistrano

Problem
With the imminent upgrade in Dreamhost to Rails 2.1.1 (dreamhost blog post here), you may want to freeze your Rails version to a previous version, using capistrano.

Solution
On your local development pc freeze the rails:
rake rails:freeze:gems
Add the new code to your svn repository:
svn commit -m ‘freeze rails’
And then deploy to dreamhost using capistrano:
cap deploy
Your rails project [...]

4 Comments » - Posted in ruby on rails by kosmas

Wednesday, July 16th, 2008

Developing in Rails 2.1 and deploying in Rails 2.0.2 (or error – undefined method time_zone)

Problem
You are developing on the latest version of Rails (2.1), but your production server for deployment uses version 2.0.2 (as dreamhost is using at the moment).
Solution

First change the environment.rb file to use the rails version in your deployment server
RAILS_GEM_VERSION = ‘2.0.2′ unless defined? RAILS_GEM_VERSION

You should probably be geting the error: undefined method = time [...]

No Comments » - Posted in ruby on rails by kosmas

Wednesday, May 7th, 2008

Disabling rails web site when using mongrel,Apache,capistrano 1.4.1

Problem
You want to disable your rails web site for maintenance, but your application uses an older capistrano version than the one currently installed.
Solution
According to the RubyOnRails Cookbook recipe 13.12, it should only be a case of running cap disable_web (enable_web).
But in the meantime you have upgraded your capistrano version to version 2, and started using [...]

No Comments » - Posted in ruby on rails by kosmas

Thursday, February 14th, 2008

Using older Capistrano version 1.x after upgrading to Capistrano 2.x

Problem
You have just upgraded your Capistrano installation to version 2.x, but you didn’t have time to convert your recipes to the newer version.
Solution
In order to be able to use your old recipes of Capistrano version 1.x after upgrading, you can use the following (assuming your version 1.x is 1.4.1):
cap _1.4.1_ deploy
or, if you have migrations [...]

No Comments » - Posted in ruby on rails by kosmas

Friday, November 30th, 2007

cap deploy_with_migrations default behaviour

Problem
When using cap deploy_with_migrations, the default behaviour is to deploy with the migrations in the production environment.
Solution
To change this behavior add:

set :rails_env, “development”
in your config/deploy.rb

No Comments » - Posted in ruby on rails by kosmas

Monday, November 26th, 2007

Keeping uploaded files between deployments

Problem
You are using file_column plugin (or maybe another plugin?), to upload files in your ruby on rails application. Because the files are big you don’t want to have a different copy stored in your subversion repository for each different deployment version. You want to keep a common folder with all your uploaded files, and use [...]

No Comments » - Posted in ruby on rails by kosmas