Closed chijoy closed 7 years ago
Your lockfile appears to be corrupted -- it is indeed missing the qa
specification in the list of specs
Great! I assume you're referring to the Gemfile.lock, where there are a number of references to qa. And by specification do you mean a version number following it? And if so, which one, and how do I uncorrupt it? Or is it missing a qa specification in the Gemfile.lock, and if so, how do I add it? And how would this have happened? This is the first time I'm looking at this project's code. Thanks for your help!
And how would this have happened?
Old versions of Bundler were buggy and somehow didn't put all the specs in the Lockfile. I haven't seen this happen with versions of bundler >= 1.13 so I don't know the specifics
I'm closing this for now. If you're still experiencing your original issue or have any more questions don't be afraid to re-open this ticket.
@colby-swandale - I am seeing the same issue with bundler 1.15.0 in AWS Elastic Beanstalk environment. I created a sample Rails app (eg. rails new sample) added .ebextensions/01_infra.config with the following environment variables being set just to satisfy the environment enough to get running:
option_settings: aws:elasticbeanstalk:application:environment: SECRET_KEY_BASE: <key> RAILS_SKIP_MIGRATIONS: true
And when I deploy I can see the following in the log file:
/opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/spec_set.rb:39:in 'block in for': Unable to find a spec satisfying byebug in the set. Perhaps the lockfile is corrupted? (RuntimeError) from /opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/spec_set.rb:24:in 'loop' from /opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/spec_set.rb:24:in 'for' from /opt/rubies/ruby-2.3.4/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/definition.rb:218:in 'specs_for' from ./check-for-gem.rb:27:in '<main>'
Doing some debugging, it looks like the call to Bundler.definitions.groups isn't returning the expected results. However, if I downgrade the bundler to 1.13.6 it seems to work. What is the difference between 1.13.6 and 1.15.0 in how Bundler determines the groups?
@anthony-vin65 please open a new issue with the details of your problem.
@anthony-vin65 @colby-swandale I'm also having this issue with AWS ElasticBeanstalk today, after upgrading to their latest Ruby Puma Amazon Linux image. Did Anthony open a new issue for this one yet?
Anthony - you said you were able to downgrade to 1.13.6 to solve the problem.
Colby - Elastic Beanstalk is failing in a script they've provided called check-for-gem.rb:
#!/usr/bin/env /opt/rubies/ruby-current/bin/ruby
#==============================================================================
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with the License. A copy of the License is
# located at
#
# https://aws.amazon.com/asl/
#
# or in the "license" file accompanying this file. This file is distributed on
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or
# implied. See the License for the specific language governing permissions
# and limitations under the License.
#==============================================================================
require 'bundler'
Dir.chdir '/var/app/ondeck'
groups = Bundler.definition.groups
begin
Bundler.definition.resolve_with_cache!
rescue Bundler::GemNotFound
Bundler.definition(true).resolve_remotely!
end
gems = Bundler.definition.specs_for(groups).collect(&:name)
exit 0 if gems.include? ARGV[0]
Tweaking that slightly I get:
irb(main):014:0> groups.map { |g| Bundler.definition.specs_for([g]).count rescue "#{g} failed" }
=> [197, 11, "development failed", "test failed"]
Whereas on an older AWS ElasticBeanstalk box running bundler 1.12.1 I get:
irb(main):005:0> groups.map { |g| Bundler.definition.specs_for([g]).count rescue "#{g} failed" }
=> [197, 11, 1, 1]
irb(main):007:0> groups.map { |g| Bundler.definition.specs_for([g]).collect(&:name).first rescue "#{g} failed" }
=> ["rake", "i18n", "bundler", "bundler"]
ie. it looks like the change in behaviour is that bundler always used to count itself in the definiton for empty groups, but now it doesn't and fails on empty groups.
Test and Development groups are "empty" because of:
$ cat .bundle/config
---
BUNDLE_DISABLE_SHARED_GEMS: "true"
BUNDLE_WITHOUT: "test:development"
I think?
Sorry to dump this comment on a closed issue. Hopefully @anthony-vin65 has opened his new issue and these details can be copied over to that one if they're still relevant.
Thanks!
@kaoru A new issue was never opened, it would be appreciated if you opened a new issue with the details of your problem. You can follow Bundler's ISSUES guide for more information.
@colby-swandale I've managed to reproduce the issue with a small example, and opened an issue here: https://github.com/bundler/bundler/issues/6017
I did rbenv install 2.6.1 as per instructions on how to install rails on Mojave. I checked it's version, etc. Then cd'd to my rails-devise-user directory cloned from GitHub. It worked on a High Sierra laptop. Now, I type rails -v and it says: version 2.3.1 is not installed. It is specified in the Gemfile. I then do: rbenv install 2.3.1. It installs. Then type rails -v and get rbenv: rails: command not found
The `rails' command exists in these Ruby versions: 2.6.1
What is going on? On the high sierra laptop, that command works fine?
I've been using Rails for about a year now. I just cloned a repository that I've been asked to take over. After cloning, I ran rake db:setup, per the README instructions. I received an error that version 2.3.1 wasn't installed. I used rbenv to install 2.3.1, than I set it up locally. I tried rake db:setup again and received the following error : LoadError: cannot load such file -- bundler/setup. Ran gem install bundler and tried running rake db:setup. I got this error: Could not find rake-12.0.0 in any of the sources Run
bundle install
to install missing gems. So I ran bundle install and got this.--- ERROR REPORT TEMPLATE -------------------------------------------------------
Error Report
Questions
Please fill out answers to these questions, it'll help us figure out why things are going wrong.
What did you do?
I ran the command
/Users/joymccaffrey/.rbenv/versions/2.3.1/bin/bundle install
What did you expect to happen?
I expected Bundler to...
What happened instead?
Instead, what happened was...
Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?
I tried...
Have you read our issues document, https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md?
...
Backtrace
Environment
Bundler settings
Gemfile
Gemfile
Gemfile.lock
--- TEMPLATE END ----------------------------------------------------------------
Unfortunately, an unexpected error occurred, and Bundler cannot continue.
First, try this link to see if there are any existing issue reports for this error: https://github.com/bundler/bundler/search?q=Unable+to+find+a+spec+satisfying+qa+%28%3E%3D+0%29+in+the+set.+Perhaps+the+lockfile+is+corrupted%3F&type=Issues
If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at: https://github.com/bundler/bundler/issues/new
Please help. :)