tags:

views:

54

answers:

4

If'n I had a 2nd computer I would just do it and see - but I've finely tuned this thing to not run 3.0 just yet ... don't want to muck it up. Took hours & hours to get here. Bascially - I want to keep rails at 2.3.8 for a while ... so will

gem update --system

update rails from version 2 -> 3? I did read the docs with no clear answer and am guessing it will, but hey, might learn something new. Otherwise I update each one (of the 8 - 1) gems that I have. thanks...

+1  A: 

That command should just update the RubyGems software, not the gems that you have installed.

From command line help:

→ gem help update
Usage: gem update GEMNAME [GEMNAME ...] [options]

  Options:
      --system                     Update the RubyGems system software
theIV
Thanks, I had not understood that, in reading I just zipped thru the docs and made an incorrect assumption.
rtfminc
A: 

theIV has answered this admirably and correctly, but I happened to be in a unique position to very specifically address your question, so here you go:

C:>gem list --local | find "rails"

rails (2.3.5)

C:>gem update --system

Updating RubyGems Updating rubygems-update Successfully installed rubygems-update-1.3.7 Updating RubyGems to 1.3.7 Installing RubyGems 1.3.7 RubyGems 1.3.7 installed

=== 1.3.7 / 2010-05-13

NOTE:

http://rubygems.org is now the default source for downloading gems.

You may have sources set via ~/.gemrc, so you should replace http://gems.rubyforge.org with http://rubygems.org

http://gems.rubyforge.org will continue to work for the forseeable future.

New features:

  • gem commands * gem install and gem fetch now report alternate platforms when a matching one couldn't be found. * gem contents --prefix is now the default as specified in --help. Bug #27211 by Mamoru Tasaka. * gem fetch can fetch of old versions again. Bug #27960 by Eric Hankins.
  • gem query and friends output now lists platforms. Bug #27856 by Greg Hazel. * gem server now allows specification of multiple gem dirs for documentation. Bug #27573 by Yuki Sonoda. * gem unpack can unpack gems again. Bug #27872 by Timothy Jones. * gem unpack now unpacks remote gems. * --user-install is no longer the default. If you really liked it, see Gem::ConfigFile to learn how to set it by default. (This change was made in 1.3.6)
  • RubyGems now has platform support for IronRuby. Patch #27951 by Will Green.

Bug fixes:

  • Require rubygems/custom_require if --disable-gem was set. Bug #27700 by Roger Pack.
  • RubyGems now protects against exceptions being raised by plugins.
  • rubygems/builder now requires user_interaction. Ruby Bug #1040 by Phillip Toland.
  • Gem::Dependency support #version_requirements= with a warning. Fix for old Rails versions. Bug

    27868 by Wei Jen Lu.

  • Gem::PackageTask depends on the package dir like the other rake package tasks so dependencies can be hooked up correctly.


RubyGems installed the following executables: C:/lang/Ruby/bin/gem

RubyGems system software updated

C:>gem list --local | find "rails"

rails (2.3.5)

wilsona
You need to indent your paste by a tab or 4 spaces.
wuputah
Ah, thanks for the answer - its what I was wanting to try.
rtfminc
+3  A: 

"gem update --system" only updates RubyGems

"gem update" will update all installed gems to their latest versions, so it will will update raills to 3.0.0.

Before updating the gems you can freeze your application to rails 2.3.8 by executing

rake rails:freeze:gems

in your application folder. Thus your application will be associated and run in rails 2.3.8 environment even if you update the global gem to rails 3.

You can anytime install

gem install rails -v 2.3.8 (or another version of your choice)

to install older version of rails along with the latest one and create and develop an app with whichever version you're comfortable with

Or you can install RVM to create and switch between any number of ruby/rails development environments, e.g. Ruby 1.8.7 with Rails 2.3.9 and ruby 1.9.2 with Rails 3.0.0 and so on.

svilenv
Thanks, I had not understood that it would only update RubyGems, learned lots, and some great other information that tied things together for me.
rtfminc
A: 

I would recommend you switch your project to use bundler, then you can stop worrying about this. It's easy (and well tested) to do with Rails 2.3.8 and it's designed to solve this problem.

Your next best bet is to install RVM and use gemsets. Alternately, you can check out rip.


(I know this doesn't directly answer your question - I was going to post this as a comment, but with the amount of content I wanted to put it in, my only choice was to provide an answer.)

wuputah
Excellent! I have a project under 2.3.8 and want to now start delving into 3.0. I had tried two ruby versions together and things sucked, so spent a fair amount of time getting back to where I wanted. This recommendation is cool, thanks.
rtfminc