views:

244

answers:

3

says if i develop a Ruby on Rails application using Rails 2.3.2, will that usually be compatible with Passenger on my hosting company?

If i ssh to my hosting company and type rails -v, i get 2.2.2... so looks like they might be using Rails 2.2.2.

So if i develop a Rails app on my Macbook and ftp all files over there, will the Passenger there usually work well with the generated code with the current version of Rails?

+1  A: 

I would verify the version of Passenger they have installed (or confirm they have it installed at all). I would also suggest you freeze your version of Rails.

Jim Barnett
This is correct and important -- older versions of Passenger do not support Rails 2.3's renaming of app/controllers/application.rb to application_controller.rb, and will choke on it even if Rails is frozen into vendor.
Ian Terrell
+2  A: 

Freeze rails into vendor/rails using the built in rake task. That way your app will ue the version of rails you want it to no matter where you deploy it.

rake rails:freeze:gems

And the easiest way to do a specific version I know of.

rake rails:freeze:edge RELEASE=2.3.2.1

Now your version of rails will go with you where you send your app.

You can unpack other gem dependencies into vendor/gems for any gem you are using and want to be sure that it is available where ever you deploy the application.

rake gems:unpack

And to ensure their dependencies go to:

rake gems:unpack:dependencies

I would also suggest that you verify that they are running the latest version of passenger.

railsninja
Would he also need to make changes to his path or will the frozen Rails automatically get picked up regardless of the path?
pez_dispenser
I believe that the Rails app will check for vendor/rails first and then go off to the system to get defined version in environment.rb
railsninja
A: 

Just second something for railsninja's answer .

First say, it won't work straightaway.

Is that host a vps to you or have sudo access somehow?

If yes, I suggest you to do rake gems:install instead of gems:unpack, because some of gems are os dependent e.g (Rcov, RedCloth...etc.)

I will ask the hosting company of their passenger's configuration, the important question will be if they use RailsSpawnMethod: smart or smart-lv2(default).If they use the smart method, then it is a better idea to freeze your gems and rails otherwise will have the compatible issue as you can find reference from passenger user manual about the RailsSpawnMethod.

It will be nearly 100% compatible if you freeze your gems(all the gems need to be declared correctly in the environment.rb with config.gem, e.g(config.gem 'will_paginate',:source=>"http://gems.github.com")) and RAILS!!!!!

Shuoling Liu