Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why "bundle update" doesn't update the Gemfile to use Rails 3.0.5?

I tried using bundle update for a Rails 3.0.0 project I created, expecting all the content in Gemfile (and also Gemfile.lock) to reflect rails 3.0.5...

But it keep on being 3.0.0... even if I run bundle update rails, it still keep on being 3.0.0

Out of curiosity, I created a brand new Rails 3.0.0 project, and then run bundle update on it... and it still says "using rails 3.0.0", why? And how to make bundle update update to 3.0.5? (other than the obvious way to change the Gemfile by hand)

(I even tried changing sqlite3-ruby to sqlite3 in the Gemfile, because 3.0.5 seems to use sqlite3 instead. And rails and sqlite3 are the only 2 gems listed in Gemfile)

like image 287
nonopolarity Avatar asked Apr 03 '11 19:04

nonopolarity


2 Answers

You already had the answer: change the gem version by hand and run bundle update rails.

I suspect you have gem 'rails', '3.0.0' in your Gemfile. Running bundle update rails won't change the version if you have the exact version specified.

Here's some info about the different ways of specifying gem versions in your Gemfile.

http://gembundler.com/rationale.html

like image 146
James Avatar answered Sep 30 '22 21:09

James


Yeah you probably have

gem 'rails', '3.0.0'

change it to

gem 'rails', '~>3.0.0'

This will only upgrade minor versions of rails(3.0.5 & 3.0.6 ...). Or you can change it to

gem 'rails', '~>3.0'

if you want to upgrade to rails 3.1 but not 4.0

like image 40
drhenner Avatar answered Sep 30 '22 22:09

drhenner