简体   繁体   中英

Ruby Gem installed through bundler and Gemfile not loading

Checkr is the gem I have built recently and code is hosted in github and gem is hosted in rubygems.org. If we install it using bundler, specifying gem 'checkr' in Gemfile, it is not loading. We get this error:

uninitialized constant Checkr (NameError)

But installing it from github like this in Gemfile works fine, I guess.

gem 'checkr', git: 'https://github.com/vijendra/checkr.git'

Am I missing some thing in rubygems.org settings?

$ gem install checkr
Successfully installed checkr-0.0.2
1 gem installed

$ ruby -e "require 'checkr'"
/Users/radarek/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:121:in `require': cannot load such file -- checkr/base (LoadError)
        from /Users/radarek/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:121:in `require'
        from /Users/radarek/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/checkr-0.0.2/lib/checkr.rb:1:in `<top (required)>'

$ ls /Users/radarek/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/checkr-0.0.2/lib/checkr/
candidate.rb  core_ext.rb  report.rb  subaccount.rb  version.rb

As you see your gem release has missing base.rb file. I cloned your github repo and build gem locally. This gem has all files from lib/checkr/ included so you just have to release new version of your gem and it will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM