2

I want to put a debugger in a file for testing, but can't find where Bundler installs gems pulled from Github on my local machine.

I've looked at this thread http://bundler.io/v1.5/git.html which shows how to setup a local file repo to pull from, but I would rather avoid this as my situation is a one off debugging scenario.

Clay Morton
  • 333
  • 2
  • 15

3 Answers3

2

I use rbenv for my ruby and gem management. When I pull in a gem from a git repo, it places the files for the gem here:

/usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/gem-name-SHA/

craig.kaminsky
  • 5,588
  • 28
  • 31
  • Ah I see, I use rvm and it seem to install in a different place than local gems. – Clay Morton May 17 '16 at 17:56
  • I think you can just run `rvm gemdir` to find what your local directory is for gems (it's been quite a while since I used RVM :)) – craig.kaminsky May 17 '16 at 18:06
  • 1
    That's the command, but that only shows where locally installed gems are stored. – Clay Morton May 17 '16 at 18:28
  • Sorry, Clay ... isn't that what you were looking for? Where the local gems are stored so you could throw in a breakpoint, etc.? Apologies if I misunderstood your request – craig.kaminsky May 17 '16 at 18:32
  • Yes, I didn't state that well. For gems in my Gemfile that are getting pulled from Github( a remote source) I am looking for where they are installed on my local machine. They don't get installed in the same place as the rest of the gems that are installed without specifying a source. Normally you can run gem which [GEM] and it tells you where it's stored, but not when pulled from remote server. – Clay Morton May 17 '16 at 18:36
  • Oh! Gotcha! My bad ... I did not realize that RVM installed them elsewhere (RBENV is really good about just throwing them all in the same "folder" if you will). Quick question: what IDE/Text editor do you use? FWIW, RubyMine, which I know lots of devs don't want, has a great feature where you can get right to a gem (where it's locally installed) and edit/mess it up, etc. – craig.kaminsky May 17 '16 at 18:39
  • Props to Rbenv and RubyMine, I use spacemacs:) – Clay Morton May 17 '16 at 18:44
2

On my machine bundler installed the gem in:

~/.rvm/gems/ruby-2.3.3/bundler/gems/gem-from-github
0

gem which [GEM] doesn't work on its own, but bundle exec gem which [GEM] does.

Daniel Heath
  • 404
  • 2
  • 7