# Making Rails application dependent

**URL:** <https://www.ruby-forum.com/t/making-rails-application-dependent/133128>\
**Category:** Rails\
**Created:** [March 28, 2008, 4:51am UTC](https://www.ruby-forum.com/t/making-rails-application-dependent/133128 "2008-03-28T04:51:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhaval\_parikh33](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bcef8e/32.png) [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Post date:** [March 28, 2008, 4:51am UTC](https://www.ruby-forum.com/t/making-rails-application-dependent/133128/1 "2008-03-28T04:51:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dhaval\_parikh33](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bcef8e/32.png) [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Post date:** [March 28, 2008, 5:25am UTC](https://www.ruby-forum.com/t/making-rails-application-dependent/133128/2 "2008-03-28T05:25:32Z")

</div>

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’

---

<div class="post-metadata">

**Author:** ![dhaval\_parikh33](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bcef8e/32.png) [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Post date:** [March 28, 2008, 6:12am UTC](https://www.ruby-forum.com/t/making-rails-application-dependent/133128/3 "2008-03-28T06:12:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dhaval\_parikh33](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bcef8e/32.png) [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Post date:** [March 29, 2008, 9:46am UTC](https://www.ruby-forum.com/t/making-rails-application-dependent/133128/4 "2008-03-29T09:46:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dhaval\_parikh33](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bcef8e/32.png) [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Post date:** [March 28, 2008, 11:00am UTC](https://www.ruby-forum.com/t/making-rails-application-dependent/133128/5 "2008-03-28T11:00:10Z")

</div>

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
