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

Bundler::GemNotFound: Could not find with ruby 2.1.0 and bundler 1.5.0 #2780

Closed
sanemat opened this issue Dec 27, 2013 · 41 comments
Closed

Bundler::GemNotFound: Could not find with ruby 2.1.0 and bundler 1.5.0 #2780

sanemat opened this issue Dec 27, 2013 · 41 comments

Comments

@sanemat
Copy link
Contributor

sanemat commented Dec 27, 2013

When bundle, I met errors below, but after I installs manually gem install minitest -v '4.7.5', I can install bundled gems completely. Is this bundler problem?

Bundler::GemNotFound: Could not find minitest-4.7.5.gem for installation
An error occurred while installing minitest (4.7.5), and Bundler cannot continue.
Make sure that `gem install minitest -v '4.7.5'` succeeds before bundling.
Bundler::GemNotFound: Could not find json-1.8.1.gem for installation
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.

my environment:

$ ruby -v
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin13.0]
$ gem -v
2.2.0
$ bundle -v
Bundler version 1.5.0
Mac os x 10.9.1
@sanemat
Copy link
Contributor Author

sanemat commented Dec 27, 2013

$ gem list

*** LOCAL GEMS ***

actionpack (4.0.2, 3.2.16)
activemodel (3.2.16)
activesupport (4.0.2, 3.2.16)
addressable (2.3.5)
atomic (1.1.14)
aws-sdk (1.31.3)
bigdecimal (1.2.3)
builder (3.2.2, 3.1.4, 3.0.4)
bundler (1.5.0, 1.5.0.rc.2)
byebug (2.5.0)
capify-ec2 (1.5.3)
capistrano (2.15.5)
capistrano-ext (1.2.1)
coderay (1.1.0)
colored (1.2)
columnize (0.3.6)
coveralls (0.7.0)
debugger-linecache (1.2.0)
diff-lcs (1.2.5)
docile (1.1.1)
dotenv (0.9.0)
ec2ssh (2.0.7)
erubis (2.7.0)
excon (0.31.0)
faraday (0.8.8)
ffi (1.9.3)
ffi-compiler (0.1.3)
fog (1.19.0)
formatador (0.2.4)
gisty (0.2.6)
hashr (0.0.22)
highline (1.6.20)
hike (1.2.3)
hotwater (0.1.2)
i18n (0.6.9)
io-console (0.4.2)
journey (1.0.4)
json (1.8.1)
mami (1.0.0)
method_source (0.8.2)
mime-types (2.0)
mini_portile (0.5.2)
minitest (5.2.0, 4.7.5)
multi_json (1.8.2)
multipart-post (1.2.0)
net-scp (1.1.2)
net-sftp (2.1.2)
net-ssh (2.7.0)
net-ssh-gateway (1.2.0)
nokogiri (1.6.1)
octokit (2.7.0)
oj (2.5.1)
pry (0.9.12.4)
pry-doc (0.5.0)
pry-nav (0.2.3)
pry-rails (0.3.2)
pry-remote (0.1.7)
psych (2.0.2)
rack (1.5.2, 1.4.5)
rack-cache (1.2)
rack-test (0.6.2)
rake (10.1.1, 10.1.0)
rdoc (4.1.0)
reditor (0.3.3)
rest-client (1.6.7)
rspec (3.0.0.beta1)
rspec-expectations (3.0.0.beta1)
rspec-support (3.0.0.beta1)
ruby-hmac (0.4.0)
safe_yaml (0.9.7)
sawyer (0.5.2)
simplecov (0.8.2)
simplecov-html (0.8.0)
slop (3.4.7)
spring (1.0.0)
sprockets (2.2.2)
sshkit (1.3.0)
term-ansicolor (1.2.2)
test-unit (2.1.0.0)
thor (0.18.1)
thread_safe (0.1.3)
tilt (1.4.1)
tins (0.13.1)
travis-lint (1.7.0)
tzinfo (1.1.0, 0.3.38)
uuidtools (2.1.4)
yard (0.8.7.3)
zeus (0.13.3)

@indirect
Copy link
Member

Thank you for reporting this. Can you please supply all of the information requested in ISSUES so that we can try to diagnose the problem? Thanks!

@sanemat
Copy link
Contributor Author

sanemat commented Dec 27, 2013

Thanks, this is minimal reproduce:

$ bundle env
Bundler 1.5.0
Ruby 2.1.0 (2013-12-25 patchlevel 0) [x86_64-darwin13.0]
Rubygems 2.2.0
GEM_HOME


Gemfile
# A sample Gemfile
source "https://rubygems.org"

gem "json", '1.8.1'


Gemfile.lock
<No Gemfile.lock found>
$ bundle
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...

Bundler::GemNotFound: Could not find json-1.8.1.gem for installation
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.

@eagletmt
Copy link
Contributor

This problem also happens with ruby 2.0.0 and Gemfile gem 'json', '1.7.7'.
bundle install fails if gems shipped with ruby (e.g. json) are requested.
It's caused by bffb319 .

@skaes
Copy link

skaes commented Dec 27, 2013

I can confirm the problem. Gems installed as part of the ruby install process are not found by bundler version 1.5.

Works with bundler version 1.3.5.

indirect added a commit that referenced this issue Dec 27, 2013
@indirect
Copy link
Member

Please test the patch I just pushed and let me know if that fixes it for you.

@skaes
Copy link

skaes commented Dec 27, 2013

Fixes it for me.

@eagletmt
Copy link
Contributor

@indirect bundle install still fails if ruby is 1.9.3 and Gemfile specifies gem 'json', '1.5.5'.
1.9.3-p448 with rubygems 1.8.23 doesn't have "specifications/default" directory.

ruby >= 2.0.0 is OK.

@grk
Copy link

grk commented Dec 27, 2013

Any chance for a release with that fix? Or at least an rc? :)

@hone
Copy link
Contributor

hone commented Dec 27, 2013

@eagletmt this fails for me locally with bundler 1.3.5 as well when using ruby 1.9.3-p484. Does it work for you?

@eagletmt
Copy link
Contributor

@hone Yes.

bundle env

Bundler 1.3.5
Ruby 1.9.3 (2013-11-22 patchlevel 484) [x86_64-linux]
Rubygems 1.8.23
GEM_HOME 


Gemfile
source "https://rubygems.org"
gem 'json', '1.5.5'


Gemfile.lock
<No Gemfile.lock found>

bundle install

Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using json (1.5.5) 
Using bundler (1.3.5) 
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

I confirmed bundler 1.5.0.rc.2 also works for me.

@jonleighton
Copy link

@indirect I also experienced this problem and your patch works for me.

@indirect
Copy link
Member

On Ruby 1.9 my patch was not sufficient in my testing, but I believe that a1eed77 fixes it on 1.9. If someone else can confirm that, I'll get 1.5.1 released.

@eagletmt
Copy link
Contributor

@indirect The commit fixes it for me on ruby 1.9.3. I didn't think of that 😲

@indirect
Copy link
Member

Released 1.5.1 with support for default gems in Ruby 1.9 and 2.0! Thanks for the reports, everyone.

@sanemat
Copy link
Contributor Author

sanemat commented Dec 28, 2013

Thanks! 🎉 1.5.1 works fine for me.

@carloslopes
Copy link

Thanks for the hard work! ❤️

prathamesh-sonpatki added a commit to prathamesh-sonpatki/codetriage that referenced this issue Dec 29, 2013
- Travis is giving errors with Ruby 2.1
  https://travis-ci.org/codetriage/codetriage/builds/15980297
- Upgrading bundler version solves this issue rubygems/bundler#2780
ruedap added a commit to ruedap/daplog that referenced this issue Dec 29, 2013
amatriain added a commit to amatriain/feedbunch that referenced this issue Dec 29, 2013
This hopefully fixes a problem I'm currently having with bundler not being able to find certain gems:

  rubygems/bundler#2780
ledermann added a commit to ledermann/ibanomat that referenced this issue Dec 30, 2013
ledermann added a commit to ledermann/unread that referenced this issue Dec 30, 2013
@sgerrand
Copy link

sgerrand commented Jan 9, 2014

Well you can use sudo bundle install because sometime permission issues :)

Facetious comment? Escalating privileges won't help here.

@pmontrasio
Copy link

No permission issues. I'm on Ruby 2.1.0 and the solution (or workaround?) is gem install bundle, which today installs 1.5.2, followed by bundle install, which works now.

@aluappinheiro
Copy link

This error persists in my app.

bundle package
Using rake (10.1.1)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.8.4)
...
..
Could not find minitest-4.7.5.gem for installation


bundle env
Bundler 1.5.2
Ruby 2.1.0 (2013-12-25 patchlevel 0) [i686-linux]
Rubygems 2.2.1
rvm 1.25.12 (stable)
GEM_HOME /home/aluap.pinheiro/.rvm/gems/ruby-2.1.0-p0
GEM_PATH /home/aluap.pinheiro/.rvm/gems/ruby-2.1.0-p0:/home/aluap.pinheiro/.rvm/gems/ruby-2.1.0-p0@global
rubygems-bundler (1.4.2)

gem 'rails', '4.0.2'


Any idea to fix this problem??

@pmontrasio
Copy link

I confirm that bundle package gives that error. However everything else works fine. I didn't even know about the package command...
I have a slightly different configuration with rvm 1.25.14

Bundler 1.5.2
Ruby 2.1.0 (2013-12-25 patchlevel 0) [x86_64-linux]
Rubygems 2.2.1
rvm 1.25.14 (stable)
rubygems-bundler (1.4.2)

@indirect
Copy link
Member

indirect commented Feb 3, 2014

@aluappinheiro since Bundler 1.5.2 fixes the problem reported in this ticket, please follow ISSUES to open a new ticket for your issue. Thanks.

indirect added a commit that referenced this issue Feb 6, 2014
It turns out that this has some pretty extensive repurcussions, and
makes it impossible to use Bundler in some specific circumstances, like
with gems that ship with Ruby, and with gems that are installed by distro
packages. It also breaks the `bundle pack` command, because the gems
that are cached by the pack command are not found by this check.

See also:

#2854
#2780

This reverts commit bd0243e.
indirect added a commit that referenced this issue Feb 6, 2014
It turns out that this has some pretty extensive repurcussions, and
makes it impossible to use Bundler in some specific circumstances, like
with gems that ship with Ruby, and with gems that are installed by distro
packages. It also breaks the `bundle pack` command, because the gems
that are cached by the pack command are not found by this check.

See also:

#2854
#2780

This reverts commit bd0243e.
indirect added a commit that referenced this issue Feb 6, 2014
It turns out that this has some pretty extensive repurcussions, and
makes it impossible to use Bundler in some specific circumstances, like
with gems that ship with Ruby, and with gems that are installed by distro
packages. It also breaks the `bundle pack` command, because the gems
that are cached by the pack command are not found by this check.

See also:

#2854
#2818
#2780

This reverts commit bd0243e.
@BrandonMathis
Copy link

@pmontrasio, have you tried updating rubygems?

gem update --system

@mishaker
Copy link

I have the same problem :

bundle package
...
Using rvm-capistrano (1.4.3)
Using sdoc (0.4.0)
Using sqlite3 (1.3.8)
Using therubyracer (0.11.4)
Using thin (1.5.1)
Using turbolinks (2.2.0)
Using uglifier (2.4.0)
Using unicorn (4.8.2)
Your bundle is complete!
Use bundle show [gemname] to see where a bundled gem is installed.
Updating files in vendor/cache

  • rake-10.1.1.gem
  • i18n-0.6.9.gem
    Could not find minitest-4.7.5.gem for installation

ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]
Bundler version 1.5.3

"bundle install" works well though !

@ashleydw
Copy link

ashleydw commented Mar 5, 2014

Getting the same, even though gem list shows minitest (5.3.0, 5.2.3, 4.7.5)

ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0] Bundler version 1.5.3

Updating files in vendor/cache
Could not find minitest-4.7.5.gem for installation

@indirect
Copy link
Member

indirect commented Mar 5, 2014

I guess the fix for caching with gems that are built in to ruby isn't working on 2.1. We'll try to get this fixed soon!

On Wed, Mar 5, 2014 at 8:43 AM, ashleydw [email protected] wrote:

Getting the same, even though gem list shows minitest (5.3.0, 5.2.3, 4.7.5)
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0] Bundler version 1.5.3

Updating files in vendor/cache
Could not find minitest-4.7.5.gem for installation```
---
Reply to this email directly or view it on GitHub:
https://github.com/bundler/bundler/issues/2780#issuecomment-36763564

@skull-squadron
Copy link

Our current hackaround (bundler 1.5.3):

bundle package --all || \
{ cp /path/to/other/project/vendor/cache/minitest-4.7.5.gem vendor/cache && \
  bundle package --all ;} && \
 bundle --local --deployment

@indirect
Copy link
Member

You could just use gem fetch minitest -v 4.7.5 :)

That said, I think it makes sense for Bundler to actively download minitest if it’s somehow missing, which seems to be the case in #2923.

On Mar 14, 2014, at 9:46 AM, Barry Allard [email protected] wrote:

Our current hackaround:

bundle package --all ||
{ cp /path/to/other/project/vendor/cache/minitest-4.7.5.gem vendor/cache &&
bundle package --all ;} &&
bundle --local --deployment

Reply to this email directly or view it on GitHub.

@skull-squadron
Copy link

@indirect Won't work. It would take a network hit and save the gem to cwd, not vendor/cache.

What we're seeing likely isn't #2923 because minitest 4.7.5 is installed globally.

It's probably related dependencies calculations with BUNDLE_DISABLE_SHARED_GEMS: '1'

@skull-squadron
Copy link

Here's an extracted Gemfile that is exhibiting this consistently, but it could well be something local:

https://gist.github.com/9552190

@ted-collins
Copy link

FWIW, I followed @indirect's suggestion of re-fetching the gems (json and minitest) and tossed them into vendor/cache; and (unsurprisingly) it worked. I have the gems installed globally as well, but am using rvm for my www-data user (Ubuntu). Thanks for working on this.

[[ruby 2.1.1, bundle 1.5.3, json 1.8.1, minitest 4.7.5, ubuntu 13.10]]

@skull-squadron
Copy link

This is a bug, copying gems is not a solution.

@indirect
Copy link
Member

I never said it was a solution. I said it was something you could do. If a fix is important to you, feel free to fix it instead of waiting for me to have enough free time to take care of it.

On Fri, Apr 11, 2014 at 10:42 AM, Barry Allard [email protected]
wrote:

This is a bug, copying gems is not a solution.

Reply to this email directly or view it on GitHub:
#2780 (comment)

@skull-squadron
Copy link

Defensiveness isn't constructive. Could just say "Busy atm, patches welcome."

@indirect
Copy link
Member

lol. That wasn’t me trying to be defensive, that was me trying to subtly point out that you were being demanding and rude. Since you want to make a big deal out of it: You're not entitled to anything here, and your comment wasn’t constructive or helpful.

Also, I’m too busy at this exact moment, but patches are welcome. :)

On Apr 11, 2014, at 11:37 AM, Barry Allard [email protected] wrote:

Defensiveness isn't constructive. Could just say "Busy atm, patches welcome."


Reply to this email directly or view it on GitHub.

@hrach
Copy link

hrach commented Jul 12, 2014

I'm getting this error too. Windows 8, bundler 1.5.3, ruby 2.0.0p481.
Any tip how to get it work?

@indirect
Copy link
Member

Upgrade to the latest Bundler version.

On Sat, Jul 12, 2014 at 4:21 PM, Jan Škrášek [email protected]
wrote:

I'm getting this error too. Windows 8, bundler 1.5.3, ruby 2.0.0p481.

Any tip how to get it work?

Reply to this email directly or view it on GitHub:
#2780 (comment)

@bendizen
Copy link

I get this error in OSX 10.10, bundler 1.7.5, ruby 1.9.3p392

@TimMoore
Copy link
Contributor

@mkarlovich this issue is closed. If you're still having problems, start wit the troubleshooting steps at https://github.com/bundler/bundler/blob/master/ISSUES.md and if those don't solve it, please follow the instructions in that document for creating a new issue.

@IgorGanapolsky
Copy link

Fixes it for me.

What fixed it for you?

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