Different Versions of Rails

1 view
Skip to first unread message

DAZ

unread,
Jan 15, 2008, 3:12:42 AM1/15/08
to Ruby on Rails: Talk
I'm getting very confused with how the versions of Rails work and
wondered if somebody could explain it to me (preferably as basically
as possible, treat me as a beginner!)

The situation is that I have a desktop machine that has Rails 1.2.3 in
which I created a couple of sites. I then uploaded them to a hosted
server that is running Rails 1.2.5. The apps run fine on this server.
I have now bought a laptop and if I install Rails it will be at
version 2+. I also want to update the version I am running on my
desktop. My hosts have no plans at present to upgrade to version 2 of
Rails.

Here are my questions:
What line would it be that forces the production site on the hosted
server to use their version of rails rather than the version it was
created in?
How can I update my desktop machine's version of Rails and then
continue to develop these 2 sites if they specify that a previous
version should be used?
I've read about freezing edge Rails. This seems to imply that you
include a whole version of rails as part of the site's code. Can I do
this with these projects and effectively choose which version of Rails
is used on a project by project basis? Would I be able to freeze a
version of Rails 2.x onto my hosted server to enable me to make use of
Rails 2.0 in a hosted environment or will I have to wait until they
upgrade?

I hope that makes sense. Thanks in advance,

DAZ

Frederick Cheung

unread,
Jan 15, 2008, 4:58:58 AM1/15/08
to rubyonra...@googlegroups.com

On 15 Jan 2008, at 08:12, DAZ wrote:

>
> I'm getting very confused with how the versions of Rails work and
> wondered if somebody could explain it to me (preferably as basically
> as possible, treat me as a beginner!)
>
> The situation is that I have a desktop machine that has Rails 1.2.3 in
> which I created a couple of sites. I then uploaded them to a hosted
> server that is running Rails 1.2.5. The apps run fine on this server.
> I have now bought a laptop and if I install Rails it will be at
> version 2+. I also want to update the version I am running on my
> desktop. My hosts have no plans at present to upgrade to version 2 of
> Rails.
>

You can install old version of rails if you want.


> Here are my questions:
> What line would it be that forces the production site on the hosted
> server to use their version of rails rather than the version it was
> created in?
> How can I update my desktop machine's version of Rails and then
> continue to develop these 2 sites if they specify that a previous
> version should be used?
> I've read about freezing edge Rails. This seems to imply that you
> include a whole version of rails as part of the site's code. Can I do
> this with these projects and effectively choose which version of Rails
> is used on a project by project basis? Would I be able to freeze a
> version of Rails 2.x onto my hosted server to enable me to make use of
> Rails 2.0 in a hosted environment or will I have to wait until they
> upgrade?
>

freezing just means that a version of rails is copied into vendor/
rails. That version is then using, independantly of what gems are
installed. It can be edge, or just a regular version of rails (so that
the version you use is independant from what gems are installed, you
have have a different version for each project etc...). You can
certainly freeze 2.0 into a project and run that on a server which
only has 1.2 installed (or even no version of rails).

Fred

Message has been deleted
Message has been deleted

DAZ

unread,
Jan 15, 2008, 4:14:04 PM1/15/08
to Ruby on Rails: Talk
Thanks for the reply Fred. This sounds like good news - basically I
can choose which version of Rails each individual application uses and
this won't depend on which machine it is running? Will ruby still have
to be installed on the host?

Are there any good instructions of how to freeze a copy of rails into
an application and do you need rails installed in the first place to
do it?

Another question is what if I use some ruby gems. I often install
bluecloth so that I can use markdown and luckily my host also has this
installed. Can I freeze this into the app aswell?

cheers,

DAZ

On Jan 15, 9:58 am, Frederick Cheung <frederick.che...@gmail.com>
wrote:

>
> freezing just means that a version ofrailsis copied into vendor/rails. That version is then using, independantly of what gems are
> installed. It can be edge, or just a regular version ofrails(so that
> the version you use is independant from what gems are installed, you
> have have adifferentversion for each project etc...). You can

Frederick Cheung

unread,
Jan 15, 2008, 4:26:04 PM1/15/08
to rubyonra...@googlegroups.com

On 15 Jan 2008, at 21:14, DAZ wrote:

>
> Thanks for the reply Fred. This sounds like good news - basically I
> can choose which version of Rails each individual application uses and
> this won't depend on which machine it is running? Will ruby still have
> to be installed on the host?

You need ruby.


>
>
> Are there any good instructions of how to freeze a copy of rails into
> an application and do you need rails installed in the first place to
> do it?
>

Either rake rails:freeze:gems (in which case you do need the gems)
or rake rails:freeze:edge . You can specify which tag to use, so you
can get it to lock to the 1.2.5 release for example.

> Another question is what if I use some ruby gems. I often install
> bluecloth so that I can use markdown and luckily my host also has this
> installed. Can I freeze this into the app aswell?
>

You can do stuff like http://errtheblog.com/posts/50-vendor-everything

Fred

Reply all
Reply to author
Forward
0 new messages