Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Bundler updates gem index, even with a locked Gemfile #169

Closed
be9 opened this issue Mar 4, 2010 · 13 comments
Closed

Bundler updates gem index, even with a locked Gemfile #169

be9 opened this issue Mar 4, 2010 · 13 comments

Comments

@be9
Copy link

be9 commented Mar 4, 2010

Ok, I am able to reproduce it locally, without capistrano.

Take Gemfile and Gemfile.lock from http://gist.github.com/323016 and put them into an empty directory.

Remove ~/.bundle, remove all installed gems (I just created a new gemset with rvm for that purpose).

Run bundle install --without=development, the rack gem will be installed.

Run bundle install --without=development again. Index will get updated again (whereas it should NOT).

Run bundle install. Index gets updated again (it should NOT).

Now running bundle install or bundle install --without=development will work fast, as it should, no index updating.

(from comment below)

@carllerche
Copy link
Contributor

Please provide more information:

  • Ruby version
  • Rubygems version
  • Bundler version
  • Gemfile
  • Steps to reproduce.

Thanks.

@indirect
Copy link
Member

indirect commented Mar 4, 2010

I'm sorry, but you haven't provided enough information for me to reproduce your issue. If you'd like me to investigate, I need to be able to reproduce your problem. Locking works perfectly for me: https://gist.github.com/a782956fcf56a536491a

@be9
Copy link
Author

be9 commented Mar 4, 2010

Ok, this is Bundler 0.9.10 using rg 1.3.6 under RubyEE 2009.10.

Gemfile available here:
https://gist.github.com/6a01d0a1d50556ed3e99

Similar configuration works on my dev machine flawlessly, the only difference is RubyEE 2010.01 (still haven't upgraded the production server)

@indirect
Copy link
Member

indirect commented Mar 4, 2010

Are you sure that the Gemfile.lock file is present on the server before it runs bundle install? You still haven't provided steps to reproduce the problem, just told us that the same thing works fine for you on your dev machine. :\

@be9
Copy link
Author

be9 commented Mar 5, 2010

Ok, it's somehow related to Capistrano.

bundle install is run in this way:

namespace :bundler do
  desc "Run bundler, installing gems"
  task :install do
    run("cd #{release_path} && /opt/ruby-enterprise/bin/bundle install --without=development test")
  end
end

after "deploy:update_code", "db:symlink", "bundler:install"

I run cap deploy, gems are installed, see cap1.log here. When I run cap deploy second time,
index is fetched again (see cap2.log in the gist).

Then if I log in to the server manually and issue bundle install --only=development test, it fetches the index the third time, but next bundle install --only=development test works flawlessly (see ssh.log in the gist).

Interactive shell and capistrano shell apparently differ, so it may cause the trouble somehow. I'll provide more information (capistrano ENV, etc.) on request.

@indirect
Copy link
Member

indirect commented Mar 5, 2010

Your cap1.log clearly shows that all the gems are not already installed on the server. A bunch of the gems that were installed had to be downloaded from gemcutter. If you want to avoid that, you should run bundle package, and then check in both Gemfile.lock and the vendor/cache directory.

@be9
Copy link
Author

be9 commented Mar 5, 2010

cap2.log is the point actually. Nothing needs to be installed (already done, as cap1.log states), but source index is updated again :(

@indirect
Copy link
Member

indirect commented Mar 5, 2010

You're right... sorry, I don't know what could be causing that. Without a way to reproduce it myself, I don't have any way to troubleshoot it. Sorry. :(

@be9
Copy link
Author

be9 commented Mar 5, 2010

The cause might be in bundle install --without=development test.

When I ssh the server and run bundle install, which installs all the gems, no more fetching is done when running bundle install again, or bundle install --without=development test.

@be9
Copy link
Author

be9 commented Mar 5, 2010

Ok, I am able to reproduce it locally, without capistrano.

  1. Take Gemfile and Gemfile.lock from http://gist.github.com/323016 and put them into an empty directory.
  2. Remove ~/.bundle, remove all installed gems (I just created a new gemset with rvm for that purpose).
  3. Run bundle install --without=development, the rack gem will be installed.
  4. Run bundle install --without=development again. Index will get updated again (whereas it should NOT).
  5. Run bundle install. Index gets updated again (it should NOT).
  6. Now running bundle install or bundle install --without=development will work fast, as it should, no index updating.

@indirect
Copy link
Member

indirect commented Mar 5, 2010

Thanks, that's very helpful. Hopefully we can address this soon.

@indirect
Copy link
Member

indirect commented Mar 9, 2010

Fixed by 02fd9b9.

@zubin
Copy link

zubin commented Aug 3, 2010

I had the same problem and found it worked when the = was omitted, ie:

bundle install --without test cucumber development /path/to/.bundle

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants