{"action":"closed","issue":{"url":"https://api.github.com/repos/bundler/bundler/issues/3236","labels_url":"https://api.github.com/repos/bundler/bundler/issues/3236/labels{/name}","comments_url":"https://api.github.com/repos/bundler/bundler/issues/3236/comments","events_url":"https://api.github.com/repos/bundler/bundler/issues/3236/events","html_url":"https://github.com/bundler/bundler/issues/3236","id":47903515,"number":3236,"title":"Installing a gem into the system with `rake install` is breaking","user":{"login":"brandonweiss","id":4727,"avatar_url":"https://avatars.githubusercontent.com/u/4727?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonweiss","html_url":"https://github.com/brandonweiss","followers_url":"https://api.github.com/users/brandonweiss/followers","following_url":"https://api.github.com/users/brandonweiss/following{/other_user}","gists_url":"https://api.github.com/users/brandonweiss/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonweiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonweiss/subscriptions","organizations_url":"https://api.github.com/users/brandonweiss/orgs","repos_url":"https://api.github.com/users/brandonweiss/repos","events_url":"https://api.github.com/users/brandonweiss/events{/privacy}","received_events_url":"https://api.github.com/users/brandonweiss/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-11-05T23:30:55Z","updated_at":"2015-05-02T05:37:15Z","closed_at":"2015-05-02T05:37:15Z","body":"Relevant versions are `ruby 2.1.3p242`, `ruby gems 2.4.2`, and `bundler 1.7.4`.\r\n\r\nI'm working on a gem that I generated using `bundle init`. It has two development dependencies (bundler and rake, added by `bundle init`) and one regular dependency, thor, which I added.\r\n\r\nWhen it's time to test it out, I run `rake install` to install it into my system gems, and get this:\r\n\r\n```plain\r\n$ rake install\r\nfoobar 0.1.0 built to pkg/foobar-0.1.0.gem.\r\nrake aborted!\r\nCouldn't install gem, run `gem install /Users/brandon/Code/foobar/pkg/foobar-0.1.0.gem' for more detailed output\r\n\r\nTasks: TOP => install\r\n(See full trace by running task with --trace)\r\n```\r\n\r\nSo I run `gem install /Users/brandon/Code/foobar/pkg/foobar-0.1.0.gem` and get:\r\n\r\n```plain\r\n$ gem install /Users/brandon/Code/foobar/pkg/foobar-0.1.0.gem\r\nFetching: thor-0.19.1.gem (100%)\r\nSuccessfully installed thor-0.19.1\r\nSuccessfully installed foobar-0.1.0\r\n2 gems installed\r\n```\r\n\r\nI would have expected it to fail and see the reason why, but instead it installs. I uninstall both foobar and thor and try to figure out why. I run `rake install --trace` and see that it’s failing on [line 69 of gem_helper](https://github.com/bundler/bundler/blob/v1.7.4/lib/bundler/gem_helper.rb#L69). It appears that the gem is being installed with the `--local` flag. If I run `gem install /Users/brandon/Code/foobar/pkg/foobar-0.1.0.gem --local` I get:\r\n\r\n```plain\r\n$ gem install /Users/brandon/Code/foobar/pkg/foobar-0.1.0.gem --local\r\nERROR:  Could not find a valid gem 'thor' (~> 0.19.1) in any repository\r\n```\r\n\r\nOK, that probably makes sense because I install dependencies with `bundle install --path vendor`. So the thor dependency isn’t in my system gems it’s in `vendor/ruby`, which is why `gem install --local` can’t find it and `rake install` is failing. I would need to run `rake install` through Bundler in order for it to find that gem repository. So I run `bundle exec rake install` and get:\r\n\r\n```plain\r\n$ bundle exec rake install\r\nfoobar 0.1.0 built to pkg/foobar-0.1.0.gem.\r\nfoobar (0.1.0) installed.\r\n```\r\n\r\nThat appears to work but when I list out my gems it’s not there.\r\n\r\n1. I think perhaps the error output when running `rake install` should be updated to include the `--local` flag, since that is technically how it is being installed. It was slightly confusing that running the command to see the error actually wound up succeeding.\r\n2. Is this behavior a bug? Or is the problem that I shouldn’t be bundling with `--path vendor` when making a gem? I thought I’d done that previously and it had worked, but the last time I created a gem was a while ago and I can’t remember what the specifics of that environment (the different versions of everything) were in order to reproduce it."}}