Different version of RoR on server

I use rails 2.3.2. The server use 2.1.1. What do I do? Make a new app on
my side based on 2.1.1? If yes, how do I do that?

2009/7/8 PÃ¥l Bergström [email protected]:

I use rails 2.3.2. The server use 2.1.1. What do I do? Make a new app on
my side based on 2.1.1? If yes, how do I do that?

The best plan would be to get the server updated if possible.

Colin

Eric wrote:

On Jul 8, 2:15�pm, P�l Bergstr�m [email protected]
wrote:

I use rails 2.3.2. The server use 2.1.1. What do I do? Make a new app on
my side based on 2.1.1? If yes, how do I do that?

The long way would be to install 2.1.1 via “gem install rails -v
2.1.1” and change the Rails version for the app in config/
environment.rb.

Thanks. I think I’ll do that. Can change that in environment.rb without
making any other changes, considering the app is done for 2.3.2?

On Jul 8, 3:24 pm, Pål Bergström [email protected]
wrote:

Thanks. I think I’ll do that. Can change that in environment.rb without
making any other changes, considering the app is done for 2.3.2?

You will probably have to make other changes too, depending on how the
app itself is written.

-eric

On Jul 8, 2:15 pm, Pål Bergström [email protected]
wrote:

I use rails 2.3.2. The server use 2.1.1. What do I do? Make a new app on
my side based on 2.1.1? If yes, how do I do that?

The long way would be to install 2.1.1 via “gem install rails -v
2.1.1” and change the Rails version for the app in config/
environment.rb.

Eric wrote:

On Jul 8, 3:24�pm, P�l Bergstr�m [email protected]
wrote:

Thanks. I think I’ll do that. Can change that in environment.rb without
making any other changes, considering the app is done for 2.3.2?

You will probably have to make other changes too, depending on how the
app itself is written.

-eric

What about creating a new app, can I specify what version to use? Like:

rails newapp -d mysql -v 2.1.1

Or something?

On Wed, Jul 8, 2009 at 5:25 PM, Colin L.[email protected] wrote:

2009/7/8 Pål Bergström [email protected]:

I use rails 2.3.2. The server use 2.1.1. What do I do? Make a new app on
my side based on 2.1.1? If yes, how do I do that?

The best plan would be to get the server updated if possible.

Another options is to put rails 2.3.2 into the app structure itself:

On the development machine

rake rails:freeze:gems

This puts unpacks the gems which comprise rails ( activerecord,
activesupport, actionpack etc) under the vendor/rails

Assuming that deployment is via a repository (svn, git…) commit the
application making sure that vendor/rails is placed under version
control.

Then it doesn’t matter what the current ‘official’ rails version is on
the server, it will use the same version you use in development.

This is a bonus both ways, you can use a later version than the one
installed as gems on the server, and you are isolated if the ‘it guys’
update the rails gems without telling you, something which can easily
break your app.


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

Rick Denatale wrote:

On Wed, Jul 8, 2009 at 5:25 PM, Colin L.[email protected] wrote:

Another options is to put rails 2.3.2 into the app structure itself:

On the development machine

rake rails:freeze:gems

I might do this. What about updates? Will a new freeze get the latest
versions? And I can always unfreeze, right?

Rick Denatale wrote:

On Wed, Jul 8, 2009 at 5:25 PM, Colin L.[email protected] wrote:

rake rails:freeze:gems

A possibly stupid question, but why do I get a .gem directory in my home
directory when I do freeze? Well I get the idea, but why not keep the
.gem in the app root or somewhere? What happens with my other apps
running, they will use the .gem too, right?

I run rails for development under LSWS that I have installed in my home
directory, with me as a user (to keep it simple). Everything else is gem
and Macports.

On Jul 9, 9:42 am, Pål Bergström [email protected]
wrote:

versions? And I can always unfreeze, right?
Freezing unpacks the gems into vendor/rails. Unfreezing is a simple as
blowing away that directory (there’s probably a rake task that does
that too)

Fred

On Jul 9, 9:59 am, Pål Bergström [email protected]
wrote:

Rick Denatale wrote:

On Wed, Jul 8, 2009 at 5:25 PM, Colin L.[email protected] wrote:
rake rails:freeze:gems

A possibly stupid question, but why do I get a .gem directory in my home
directory when I do freeze? Well I get the idea, but why not keep the
.gem in the app root or somewhere? What happens with my other apps
running, they will use the .gem too, right?

.gem isn’t used for frozen stuff. It’s something gem does in some
cases when ran as a user that can’t write to the system wide gem
location.

Fred

On Thu, Jul 9, 2009 at 6:32 AM, Frederick
Cheung[email protected] wrote:

directory when I do freeze? Well I get the idea, but why not keep the
.gem in the app root or somewhere? What happens with my other apps
running, they will use the .gem too, right?

.gem isn’t used for frozen stuff. It’s something gem does in some
cases when ran as a user that can’t write to the system wide gem
location.

Yep, one of my peeves with gem is that it does this. I always want
gems to be installed in the system location, if I forget to sudo gem I
don’t want it to be installed in my home directory.

I finally removed all permisions from my ~/.gem directory so if I
forget, it let’s me know rather than giving me a useless install.

chmod 000 ~/.gem


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

hi,
the rails command accepts the version number, by prefixing and
appending the version number by underscore.
eg: rails 2.2.2 newapp -d mysql

Deepak

On Jul 9, 12:40 pm, Pål Bergström [email protected]

Rick Denatale wrote:

On Thu, Jul 9, 2009 at 6:32 AM, Frederick

I finally removed all permisions from my ~/.gem directory so if I
forget, it let’s me know rather than giving me a useless install.

chmod 000 ~/.gem

Clever. Thanks for the suggestion. :slight_smile:

deepak wrote:

hi,
the rails command accepts the version number, by prefixing and
appending the version number by underscore.
eg: rails 2.2.2 newapp -d mysql

Deepak

On Jul 9, 12:40�pm, P�l Bergstr�m [email protected]

Good to know.

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