hi all,
can i install different rails versions on single machine like rails
1.2.2, 1.2.6, 2.0,2.1 etc to workout different applications in different
rails versions. if yes, how? currently i’ve rails 1.2.6 and if i run
command as “gem install rails”, will it overwrite my current rails
version? what should i do to keep older and new both versions at the
same time?
-DP
The command “gem install rails” will overwrite some commands, in
particular the rails command in you path, but the rails command is
also part of the gem. Your current rails command will be 1) in your
path and 2) in some location like /usr/local/lib/ruby/gems/1.8/gems/
rails-*/bin where the * stands for the version of rails.
On Aug 25, 9:46 pm, Dhaval P. <rails-mailing-l…@andreas-
Just move rails into the “/vendor” directory of each project using
subversion (old versions) or git (newer versions).
For example, I use rails 1.2.3 for zena cms so I use (in the vendor
directory):
Gaspard
And if you need to run the actuals rails executable you can specify
the version you want eg rails 1.2.6 to run version 1.2.6 (assuming
you have the corresponding gem)
hi,
thanks for reply. wt i was thinking that i could install all those
versions on single machine and just change RAILS_GEM_VERSION in
config/environment.rb file. can this be done?
@yesterday
couldn’t get wt exactly u want to say. can u explain it a bit more on
that pls? if i do “gem install rails”, will rails-1.2.6 folder be thr
only in “C:\ruby\lib\ruby\gems\1.8\gems”? and can i use it
RAILS_GEM_VERSION in config/environment.rb file?
@gaspard
“Just move rails into the “/vendor” directory of each project using
subversion (old versions) or git (newer versions).”
sorry, i’m not much aware of git or subversion. but wt exactly u mean
by rails here? “C:\ruby\lib\ruby\gems\1.8\gems\rails-1.2.5” is it? don’t
i have to install all rails versions on the machine before that? what if
i want to have rails 2.0? can “gem update rails” fix this?
i hope i’m not creating any confusion :D. if so, pls let me know.
thanks.
P.S.:i’m using windows,rails 1.2.6
-DP
Dhaval P. wrote:
hi all,
can i install different rails versions on single machine like rails
1.2.2, 1.2.6, 2.0,2.1 etc to workout different applications in different
rails versions. if yes, how?
Freezing the appropriate Rails gems into your application(s) is your
friend in this case…
rake rails:freeze:gems
although I don’t know if that takes an argument for version or not.
“Proof of this last statement is left as an exercise for the reader”
hehe
Ar Chron wrote:
Dhaval P. wrote:
hi all,
can i install different rails versions on single machine like rails
1.2.2, 1.2.6, 2.0,2.1 etc to workout different applications in different
rails versions. if yes, how?
Freezing the appropriate Rails gems into your application(s) is your
friend in this case…
rake rails:freeze:gems
although I don’t know if that takes an argument for version or not.
“Proof of this last statement is left as an exercise for the reader”
hehe
thanks for the reply people. i thought this task is easy but it seems a
bit tricky ;).
@Phillip
i checked the help. thanks for the info 
@Ar Chron
freezing rails seems to be a good option. i tried it on a sample
application and it worked fine. but i’ve a question here.if i freez my
appl to the current rails version(1.2.6) and install 2.0. later on,just
in case, if i want to go back to the previous ver i.e. 1.2.6, i’ll do
gem install “rails -v1.2.6”. in that case, will i have to install all
other gems also like hpricot,mongrel etc?
-DP
Dhaval P. wrote:
hi,
thanks for reply. wt i was thinking that i could install all those
versions on single machine and just change RAILS_GEM_VERSION in
config/environment.rb file. can this be done?
Hi Dhaval,
Yes, it can be done. When you install a gem, you can pass it -v to tell
it what version you want. Without -v, the latest version is installed.
So install rails 2.1 right now, you could do
gem install rails
But if you want to install 1.2.6, you would do
gem install rails -v 1.2.6
gem actually has pretty good help.
gem help commands
is a good place to start. Then you can get specific with
gem help install
Peace,
Phillip
gem install rails -v=<%=version you want to install%>
eg: gem install rails -v=1.2.5
will install the rails version 1.2.5 for you. Infact this option is
available while installing any gems.
With the option “-v=” will always install the latest version of and
gem.
You can freeze a different version of rails for an different project.
In config/environment.rb specify which rails version you wan to use
for that particular project.
gem install rails -v=<%=version you want to install%>
eg: gem install rails -v=1.2.5
will install the rails version 1.2.5 for you. Infact this option is
available while installing any gems.
With the option “-v=” will always install the latest version of and
gem.
On Aug 26, 9:46 am, Dhaval P. <rails-mailing-l…@andreas-
You can can get all parts of rails (activerecord, actionpack, etc)
using subversion (http://subversion.tigris.org) or git (forgot website
name). The command using subversion would be:
cd vendor
Replace “6633” by the revision number containing the versions that you
want. Doing this, you get to use specific copies for your app, without
using the gems for rails stuff. You can use the “previous change”,
“next change” on the old trac browser to find the revision you need
(if you know rails version):
http://dev.rubyonrails.org/changeset/7843/trunk/railties/lib/rails/version.rb
You end up with a folder containing:
your app
± app
± …
± vendor
± rails
± actionmailer
± actionpack
± actionwebservice
± activerecord
± …
Gaspard