rubygems / bundler

Manage your Ruby application's gem dependencies
https://bundler.io
MIT License
4.89k stars 2k forks source link

Could not find json-1.8.1 in any of the sources #3877

Closed krainboltgreene closed 9 years ago

krainboltgreene commented 9 years ago

Problem:

$ bundle exec foreman start
Could not find json-1.8.1 in any of the sources
Run `bundle install` to install missing gems.
$ cat Gemfile
source "https://rubygems.org"

gem "json"
gem "github-pages"
gem "sass"
gem "bourbon"
gem "neat"
gem "bitters"
$ gem list | grep json
json (1.8.1)
$ foreman start
21:59:30 jekyll.1 | started with pid 54417
21:59:30 sass.1   | started with pid 54418
21:59:31 jekyll.1 | /Users/krainboltgreene/.rvm/gems/ruby-2.2.1@blankjekyll.github.io/gems/liquid-2.6.1/lib/liquid/htmltags.rb:43: warning: duplicated key at line 46 ignored: "index0"
21:59:32 jekyll.1 | Configuration file: /Users/krainboltgreene/Code/socialkardia/socialkardia.github.io/_config.yml
21:59:32 jekyll.1 |             Source: /Users/krainboltgreene/Code/socialkardia/socialkardia.github.io
21:59:32 jekyll.1 |        Destination: /Users/krainboltgreene/Code/socialkardia/socialkardia.github.io/_site
21:59:32 jekyll.1 |       Generating...
21:59:33 jekyll.1 |                     done.
21:59:33 jekyll.1 |  Auto-regeneration: enabled for '/Users/krainboltgreene/Code/socialkardia/socialkardia.github.io'
21:59:33 jekyll.1 | Configuration file: /Users/krainboltgreene/Code/socialkardia/socialkardia.github.io/_config.yml
21:59:34 jekyll.1 |       Regenerating: 14 files at 2015-07-24 21:59:34 ...done.
21:59:34 jekyll.1 |       Regenerating: 8 files at 2015-07-24 21:59:34 ...done.
21:59:34 sass.1   | >>> Sass is watching for changes. Press Ctrl-C to stop.
21:59:34 jekyll.1 |       Regenerating: 5 files at 2015-07-24 21:59:34 ...done.

Details:

$ rvm -v
rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
$ ruby -v
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
$ gem -v
2.4.6
$ bundler -v
Bundler version 1.10.5
segiddins commented 9 years ago

What's the output of bundle install --verbose?

indirect commented 9 years ago

@krainboltgreene Foreman is a gem, and you didn't put it in your Gemfile. Either add Foreman to your Gemfile and then bundle exec foreman start, or leave it out of your Gemfile and foreman start. You can't mix and match, Bundler was designed to prevent it.

krainboltgreene commented 9 years ago

@indirect Either bundler is lying or the error is bad. Look at the error and tell me that's the right thing I should be told.

indirect commented 9 years ago

What Ruby is your Foreman binstub invoking? What's the rubygems env there?

Most likely scenario is that Bundler is setting up a bundle with gems compiled for one ruby, Foreman is hijacking you to a different Ruby, and then the Jekyll app running inside Foreman tries to use the gems from the bundle (compiled for the wrong Ruby) and JSON is missing. What error message should we print in that case? How can we even detect it?

On Fri, Jul 24, 2015 at 8:39 PM, Kurtis Rainbolt-Greene notifications@github.com wrote:

@indirect Either bundler is lying or the error is bad. Look at the error and tell me that's the right thing I should be told.

Reply to this email directly or view it on GitHub: https://github.com/bundler/bundler/issues/3877#issuecomment-124793233

krainboltgreene commented 9 years ago

Good question, but since it still ends in multiple questions I would probably not have closed the issue.

indirect commented 9 years ago

@krainboltgreene we try to keep open issues pruned down to bugs in this tracker, and this doesn't look like a bug. If you have a feature request (warnings when changing Ruby executables during bundle exec, perhaps?) we have a dedicated feature tracker at bundler/bundler-features.

juvyc commented 5 years ago

Why this issue is still exist until now? Running the rails server and I got this issue and keep asking me bundle install... bundle install is working fine I didn't get any issue but when running rails server. Here's the full message.

Could not find json-1.8.3 in any of the sources
Run `bundle install` to install missing gems.