Something strange is happening, everything used to work fine a few hours ago.
I have a private gem as dependency to a project. I've added the private gem git repo as follows:
gem 'my-awesome-gem', '>=1.2.3', git: 'https://john:[email protected]/johndoe/my-awesome-gem'
When doing bundle install
it shows:
...
Using my-awesome-gem 1.2.3 from https://john:[email protected]/johndoe/my-awesome-gem (at master@bc19e27)
Bundle complete! 5 Gemfile dependencies, 21 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
But this gem doesn't show when I do gem list
. Also, when I do pry -r my-awesome-gem
or require it in the project it returns:
! Unable to load application: LoadError: cannot load such file -- my-awesome-gem
/Users/johndoe/.rbenv/versions/2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- my-awesome-gem (LoadError)
...
I've been playing around for a few hours but can't find the problem. I've tried reinstalling ruby via rbenv. I'm using Ruby 2.4.1 via rbenv.
What am I doing wrong?
When using Bundler you must engage Bundler in any code you use. That means either:
require 'bundler/setup'
require 'my-awesome-gem'
Or:
pry -r bundler/setup -r my-awesome-gem
The gem is installed, it's just not in your $LOAD_PATH
until you get Bundler to load in the Gemfile
and find all the dependencies.