The bundle currently has rails locked

2,492 views
Skip to first unread message

David Maple

unread,
Aug 20, 2012, 5:08:31 PM8/20/12
to boston-r...@googlegroups.com
Hi everyone,

I have run into a Bundler issue that I am unable to solve. 

I have two imacs that I use for development and on both of them I recently installed rails 3.1.3 (there was no rails version on there before) and ruby 1.9.3.  For about a week everything has been running smoothly and our team has been humming along.  The other night I did a git pull to grab the newest version of a project we are working on (same project we have been doing for some time and it is a rails 3.1.3 project).  When one of the devs went to test out the new iteration, he was unable to get it working.  Running 'bundle install' erorrs out saying that "You have requested rails = 3.1.3 the bundle currently has rails locked at 3.2.1 Try running update rails."  This surprised me as the rails version was off. I did rails -v, found out that someone updated this computer to rails 3.2.1.  I downgraded rails back to 3.1.3 and deleted the 3.2.1 installation.  Then I ran 'bundle install again' and received the same error.  I restarted the machine in hopes of it magically working, but alas, no luck.  

I tried running bundle install and got the same error.  I then tried running bundle update rails, which throws an error that coffee rails is locked at 3.2.2 Try running bundle update coffee-rails". If you run bundle update coffee-rails, it throws an error that rails is locked at 3.2.1 but the request is for 3.1.3.  

I have gone through this catch-22 multiple times and have tried uninstalling the coffee-rails gem, deleting the gemfile.lock file all to no avail.  Anyone smart know what is happening and how to fix this.  

I have of course googled this quite a bit to no luck.  The other imac has no problems with git pull and ran the code beautifully, nothing mentioned about a rails version change or conflict. 

Best,

David

Pablo Fernandez

unread,
Aug 20, 2012, 5:13:04 PM8/20/12
to boston-r...@googlegroups.com
I'm a bit confused, when you delete Gemfile.lock and run bundle install, what do you get? A copy and paste of console output would definitely help.

What do you get if you run bundle exec rails -v after running bundle install?

Jeremy Weiskotten

unread,
Aug 20, 2012, 5:15:47 PM8/20/12
to boston-r...@googlegroups.com
Since you're using git you should be able to revert the commit that upgraded the project to Rails 3.2, then `bundle install`.

If that's not feasible (the upgrade wasn't an isolated commit, and is mingled with functional changes), you can try `bundle update rails coffee-rails` to install compatible versions of both gems (and their dependencies). You may need to include other gems in that command if you need to downgrade other stuff.


--
You received this message because you are subscribed to the Boston Ruby Group mailing list
To post to this group, send email to boston-r...@googlegroups.com
To unsubscribe from this group, send email to boston-rubygro...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/boston-rubygroup

David Maple

unread,
Aug 20, 2012, 5:27:41 PM8/20/12
to boston-r...@googlegroups.com
Hi,

Thanks for the quick response.  Very cool.

So the project was not updated to rails 3.2.1 it has stayed fixed at 3.1.3, its this particular machine that someone updated.

Here is the console output starting with git pull:

Syncs-iMac:$ git pull
Already up-to-date.
Syncs-iMac:$ bundle install
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/..

You have requested:
  rails = 3.1.3

The bundle currently has rails locked at 3.2.1.
Try running `bundle update rails`
Syncs-iMac:$ rails -v
/Users/syncthink/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.5/lib/bundler/resolver.rb:287:in `resolve': You have requested: (Bundler::GemNotFound)
  rails = 3.1.3

The bundle currently has rails locked at 3.2.1.
Try running `bundle update rails`
    from /Users/sync/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.5/lib/bundler/resolver.rb:161:in `start'
    from /Users/sync/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.5/lib/bundler/resolver.rb:128:in `block in resolve'
    from /Users/sync/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.5/lib/bundler/resolver.rb:127:in `catch'
    from /Users/sync/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.5/lib/bundler/resolver.rb:127:in `resolve'
    from /Users/sync/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.5/lib/bundler/definition.rb:192:in `resolve'
    from /Users/sync/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.5/lib/bundler/definition.rb:127:in `specs'
    from /Users/sync/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.5/lib/bundler/environment.rb:27:in `specs'
    from /Users/sync/.rvm/gems/ruby-1.9.3-p194@global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
    from /Users/sync/.rvm/gems/ruby-1.9.3-p194@global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:60:in `setup'
    from /Users/sync/.rvm/gems/ruby-1.9.3-p194@global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:75:in `<top (required)>'
    from /Users/sync/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    from /Users/sync/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
    from /Users/sync/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /Users/sync/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:9:in `<main>'
Syncs-iMac:$ bundle update rails
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/..
You have requested:
  coffee-rails ~> 3.1.1

The bundle currently has coffee-rails locked at 3.2.2.
Try running `bundle update coffee-rails`
Syncs-iMac:$ bundle update coffee-rails
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/..

You have requested:
  rails = 3.1.3

The bundle currently has rails locked at 3.2.1.
Try running `bundle update rails`
Syncs-iMac: $

Jeremy Weiskotten

unread,
Aug 20, 2012, 5:31:57 PM8/20/12
to boston-r...@googlegroups.com
If it's just that machine, I'm guessing that `git status` would show that Gemfile and Gemfile.lock have modifications. If that's the case:

git checkout Gemfile Gemfile.lock
bundle install

Michael Durrant

unread,
Aug 20, 2012, 6:00:53 PM8/20/12
to boston-r...@googlegroups.com
definitely try just deleting the lock file and bundling again with the Gemfile set as you wish.

--
You received this message because you are subscribed to the Boston Ruby Group mailing list
To post to this group, send email to boston-r...@googlegroups.com
To unsubscribe from this group, send email to boston-rubygro...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/boston-rubygroup



--
Cheers, Michael.

Reply all
Reply to author
Forward
0 new messages