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

Bundler keep asking to checkout git repo #3242

Closed
brauliobo opened this issue Nov 7, 2014 · 18 comments
Closed

Bundler keep asking to checkout git repo #3242

brauliobo opened this issue Nov 7, 2014 · 18 comments

Comments

@brauliobo
Copy link

Bundler keep asking to checkout git repo, even after I ran it before several times. It keeps asking over and over again.
Version is 1.7.4

The git source git://github.com/coletivoEITA/omniauth-browserid.git is not yet checked out. Please run `bundle install` before trying to start your application
@indirect
Copy link
Member

indirect commented Nov 7, 2014

please see ISSUES at https://github.com/bundler/bundler/blob/master/ISSUES.md.

On Fri, Nov 7, 2014 at 4:40 AM, Bráulio Bhavamitra
notifications@github.com wrote:

Bundler keep asking to checkout git repo, even after I ran it before several times.
Version is 1.7.4

The git source git://github.com/coletivoEITA/omniauth-browserid.git is not yet checked out. Please run bundle install before trying to start your application

Reply to this email directly or view it on GitHub:
#3242

@coldnebo
Copy link

coldnebo commented Dec 2, 2014

I'm having what appears to be the same issue, but I want to clarify the above (@brauliobo can comment whether it accurately captures the problem or is something else).

I have an app with a gem specifying a git: location.
gem 'pry-plus', git: 'https://github.com/avantcredit/pry-plus.git'

  1. bundle install
  2. app works if run immediately after
  3. wait a few minutes
  4. trying to run the app again gets the error: The git source https://github.com/avantcredit/pry-plus.git is not yet checked out. Please run bundle install before trying to start your application

This is not covered in the issues.

If you add branch 'master', this error goes away (presumably because git rev-parse has the correct information instead of incomplete info?):

gem 'pry-plus', git: 'https://github.com/avantcredit/pry-plus.git', branch: 'master'

@brauliobo
Copy link
Author

@coldnebo Very interesting, gonna try this.

brauliobo added a commit to CIRANDAS/noosfero-ecosol that referenced this issue Dec 2, 2014
@indirect
Copy link
Member

indirect commented Dec 7, 2014

@coldnebo @brauliobo I can't reproduce this issue. Please provide all of the information requested in ISSUES if you would like us to investigate further. Thanks!

@indirect indirect closed this as completed Dec 7, 2014
@brauliobo
Copy link
Author

@coldnebo Unfortunetely, that didn't help.

@indirect i'll try to provide more information, but the ISSUES doesn't really helped to know what more is revelant.

@TimMoore
Copy link
Contributor

@brauliobo there are details about what information we need at https://github.com/bundler/bundler/blob/master/ISSUES.md#reporting-unresolved-problems

@TimMoore
Copy link
Contributor

@brauliobo I tried to reproduce the issue in the linked repository (https://github.com/CIRANDAS/noosfero-ecosol) and now I'm even more confused.

https://github.com/CIRANDAS/noosfero-ecosol/blob/master/plugins/oauth/Gemfile ← this is not a valid Gemfile. There's not top-level gem source so it can't be installed at all.

@brauliobo
Copy link
Author

@TimMoore
Copy link
Contributor

OK I see how this project works now, but I still can't reproduce the problem. If you want us to look at this any further, please give us the information we have requested multiple times.

After symlinking that plugin into place and running the initial bundle install, running bundle install again gives me this output, indicating that it's using the cloned git repositories as expected:

$ bundle install
Resolving dependencies...
Using rake 10.4.2
Using RedCloth 4.2.9
Using i18n 0.6.11
Using multi_json 1.10.1
Using activesupport 3.2.21
Using builder 3.0.4
Using activemodel 3.2.21
Using erubis 2.7.0
Using journey 1.0.4
Using rack 1.4.5
Using rack-cache 1.2
Using rack-test 0.6.2
Using hike 1.2.3
Using tilt 1.4.1
Using sprockets 2.2.3
Using actionpack 3.2.21
Using mime-types 1.25.1
Using polyglot 0.3.5
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 3.2.21
Using arel 3.0.3
Using tzinfo 0.3.42
Using activerecord 3.2.21
Using activeresource 3.2.21
Using bundler 1.7.9
Using rack-ssl 1.3.4
Using json 1.8.1
Using rdoc 3.12.2
Using thor 0.19.1
Using railties 3.2.21
Using rails 3.2.21
Using acts-as-taggable-on 3.0.2
Using addressable 2.3.6
Using assets_live_compile 0.1.1
Using nokogiri 1.5.11
Using xpath 2.0.0
Using capybara 2.1.0
Using coffee-script-source 1.8.0
Using execjs 2.2.2
Using coffee-script 2.3.0
Using coffee-rails 3.2.2
Using css_parser 1.3.5
Using diff-lcs 1.1.3
Using gherkin 2.4.21
Using tins 1.3.3
Using term-ansicolor 1.3.0
Using cucumber 1.0.6
Using cucumber-rails 1.0.6
Using daemons 1.1.9
Using database_cleaner 1.2.0
Using eita-jrails 0.9.3 from source at vendor/plugins/eita-jrails
Using eventmachine 1.0.3
Using exception_notification 4.0.1
Using multipart-post 2.0.0
Using faraday 0.9.0
Using fast_blank 0.0.2
Using fast_gettext 0.6.12
Using ffi 1.9.6
Using gctools 0.2.3
Using locale 2.0.9
Using gettext 2.2.1
Using hashie 3.3.2
Using htmlentities 4.3.2
Using kgio 2.9.2
Using libv8 3.16.14.7
Using magic 0.2.8
Using metaclass 0.0.4
Using mocha 1.1.0
Using newrelic_rpm 3.9.8.273
Using oauth 0.4.7
Using oauth2 0.5.2 from git://github.com/coletivoEITA/oauth2.git (at 0-5-stable)
Using omniauth 1.2.2
Using omniauth-browserid 0.0.1 from git://github.com/coletivoEITA/omniauth-browserid.git (at master)
Using omniauth-oauth2 1.0.0
Using omniauth-facebook 1.2.0
Using omniauth-google-oauth2 0.2.2
Using omniauth-oauth 1.0.1
Using omniauth-twitter 1.1.0
Using pg 0.13.2
Using premailer 1.8.2
Using premailer-rails 1.8.0
Using rails_autolink 1.1.6
Using raindrops 0.13.0
Using redis 3.2.0
Using redis-store 1.1.4
Using redis-rack 1.4.4
Using redis-actionpack 3.2.4
Using redis-activesupport 3.2.5
Using redis-rails 3.2.4
Using ref 1.0.5
Using rest-client 1.6.8
Using rmagick 2.13.4
Using rspec-core 2.10.1
Using rspec-expectations 2.10.0
Using rspec-mocks 2.10.1
Using rspec 2.10.0
Using rspec-rails 2.10.1
Using ruby-feedparser 0.9.3
Using sass 3.4.9
Using sass-rails 3.2.6

songkick-oauth2-provider at /Users/tmoore/Projects/bundler/issues/noosfero-ecosol/.gem/ruby/2.1.4/bundler/gems/oauth2-provider-85f519138bd1 did not have a valid gemspec.
This prevents bundler from installing bins or native extensions, but that may not affect its functionality.
The validation message from Rubygems was:
  duplicate dependency on activerecord (~> 3.2.0, development), (>= 0) use:
    add_runtime_dependency 'activerecord', '~> 3.2.0', '>= 0'
Using songkick-oauth2-provider 0.10.2 from git://github.com/coletivoEITA/oauth2-provider.git (at master)
Using therubyracer 0.12.1
Using thin 1.6.3
Using uglifier 2.6.0
Using unicode 0.4.4.2
Using unicorn 4.8.3
Using unicorn-worker-killer 0.4.2
Using utf8-cleaner 0.0.9
Using will-paginate-i18n 0.1.15
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

@brauliobo
Copy link
Author

@TimMoore nice, please run script/noosfero-plugins enable oauth and then bundle. The oauth plugin has a Gemfile that depends on git repos.

@TimMoore maybe this is related to RVM gemset switching, but I still cannot always reproduce this.

@TimMoore
Copy link
Contributor

@brauliobo script/noosfero-plugins enable oauth produces an error on my machine:

[13:06:12] tmoore@tmoore-macbook-pro:~/Projects/bundler/issues/noosfero-ecosol (master=) $ script/noosfero-plugins enable oauth
readlink: illegal option -- f
usage: readlink [-n] [file ...]

I guess this is a Linux-only thing? You haven't given us all of the information we ask for in https://github.com/bundler/bundler/blob/master/ISSUES.md#reporting-unresolved-problems so it's very hard for anyone to help you.

@brauliobo
Copy link
Author

@TimMoore finally I could reproduce this.
Use as Gemfile:

source :rubygems
gem 'omniauth-browserid', github: 'coletivoEITA/omniauth-browserid', branch: 'master'

Then run bundle install and then rm Gemfile.lock and then bundle exec irb.

The problem is that without the Gemfile.lock bundler can't know about the cache, which is something strange to me. It should use by default the last checked out commit.

@brauliobo
Copy link
Author

The problem is quite frequent for me as I frequently change branchs and enable/disable noosfero's plugins (which changes the Gemfile.lock)

@TimMoore
Copy link
Contributor

@brauliobo I'm a little confused about your reproduction steps. Why do you rm Gemfile.lock? I wouldn't expect bundle exec to work without a Gemfile.lock.

If you frequently change branches and enable or disable plugins, then you should run bundle install after each change to your configuration. Bundler needs Gemfile.lock to know which gems to load. Maybe consider running bundle install from the script/noosfero-plugins script.

@brauliobo
Copy link
Author

@TimMoore for gems not loaded via git, the Gemfile.lock is not necessary, it run the app with the latest versions available of the gems. The same behaviour should be valid for gems installed via git, IMO.

@TimMoore
Copy link
Contributor

Good point. Looks like bundle exec normally regenerates the lock file if all of the gems are already available locally.

@TimMoore TimMoore reopened this Feb 23, 2015
@indirect
Copy link
Member

Okay, so after trying this myself, this is the current expected behaviour. Git repositories may have been updated, and with no Gemfile.lock, bundle install needs to run to update the git repo before it is possible to bundle exec.

While it could be possible to bundle exec by simply locking to the currently checked-out git commit, it is not something that we have ever supported in the past. That means this isn't a bug, but a feature request for git repositories.

If you'd like us to add this feature to Bundler in the future, could you open a feature request at the bundler/bundler-features issue tracker? Thanks!

@brauliobo
Copy link
Author

brauliobo commented May 18, 2017

this also makes the performance of inline gemfiles (with gemfile from https://github.com/bundler/bundler/blob/master/lib/bundler/inline.rb) very bad, as it needs to fetch the git repo everytime the script is run and obviously there isn't a Gemfile.lock involved

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