Making Rails application dependent

hi all

I want to make the rails version application dependent…Say suppose i
have a website which runs on rails 2.0 version and then i want to
configure mephisto which uses rails 1.2.5 version in the same
application as a sub domain then how will i do that?

Also say If i have multiple websites which uses different rails version
then I want to make them all run on different rails version on server is
there any method to do that?

Can we do it by rake rails:freeze:edge ? or sometihng I dont have the
exact idea how to do it

Please do let me know if someone has done it b4

thanks

dhaval parikh

There are two basic ways:

  1. Freeze the version of rails you need directly into the application:

“rake rails:freeze:edge”

or

“rake rails:freeze:gems”

  1. Install the gems for each rails version you require on your web
    server:

“gem install rails --VERSION=1.2.3”

  1. Specify the application MUST use a specific version of Rails (this
    will not actually make it work though):

Require Rails gems.

require ‘rubygems’
require_gem ‘activerecord’
require_gem ‘actionpack’
require_gem ‘actionmailer’
require_gem ‘rails’

Change it to the versions you are using, like

Require Rails gems.

require ‘rubygems’
require_gem ‘activerecord’, ‘<= 1.30’
require_gem ‘actionpack’, ‘<= 1.1.0’
require_gem ‘actionmailer’, ‘<= 0.5.0’
require_gem ‘rails’, ‘<= 0.9.1’

Dhaval P. wrote:

I want to make the rails version application dependent…Say suppose i
have a website which runs on rails 2.0 version and then i want to
configure mephisto which uses rails 1.2.5 version in the same
application as a sub domain then how will i do that?

We answer all your questions at work by editing config/environment.rb
and changing this line:

Specifies gem version of Rails to use when vendor/rails is not

present
RAILS_GEM_VERSION = ‘1.2.3’

That’s what it’s for. I’m not sure what freezing Rails has over that,
yet we
have fairly good control over our servers, so they will have each
necessary
version of each gem. That’s just a matter of:

sudo gem install whatever -v=0.4.2

Maybe one freezes Rails if, for example, one cannot install gems on a
given
platform.


Phlip

ok thats really useful

i m thankful to all of you… I have tried doing this and I am
successful but when ever i install mephisto (as a subdomain) i m not
able to configure it…

every thing is proper except the log says that there is some error in
dispatch.cgi like no 10 and it throws Rails application error.

I have installed Rake version 0.7.3 and rails version 1.2.5 for it…but
i m getting the error dont know how to solve it…

If someone has a solution for it do let me know

thanks

On 28 Mar 2008, at 05:11, Phlip wrote:

sudo gem install whatever -v=0.4.2

Maybe one freezes Rails if, for example, one cannot install gems on
a given
platform.

There’s that and I find it just makes things a little easier, I can
just checkout from subversion and go without worrying about what
versions are installed on the server.

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs