sosedoff / goodreads

Goodreads API wrapper

Home Page:https://www.goodreads.com/api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not supported in Rails 6.0

drusepth opened this issue · comments

Looks like installing a fresh Rails 6.0.0 / Ruby 2.6.3 app with this gem in the Gemfile results in the following stacktrace/error upon rails console or rails server initialization:

~/Code/indent/bookscity (master *)$ rails c
Traceback (most recent call last):
	24: from bin/rails:9:in `<main>'
	23: from bin/rails:9:in `require'
	22: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/commands.rb:18:in `<top (required)>'
	21: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command.rb:46:in `invoke'
	20: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command/base.rb:65:in `perform'
	19: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	18: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	17: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	16: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/commands/console/console_command.rb:101:in `perform'
	15: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command/actions.rb:14:in `require_application_and_environment!'
	14: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command/actions.rb:22:in `require_application!'
	13: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/railties-6.0.0/lib/rails/command/actions.rb:22:in `require'
	12: from /home/drusepth/Code/indent/bookscity/config/application.rb:7:in `<top (required)>'
	11: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler.rb:114:in `require'
	10: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/runtime.rb:65:in `require'
	 9: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/runtime.rb:65:in `each'
	 8: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/runtime.rb:76:in `block in require'
	 7: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/runtime.rb:76:in `each'
	 6: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/runtime.rb:81:in `block (2 levels) in require'
	 5: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/2.6.0/bundler/runtime.rb:81:in `require'
	 4: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/goodreads-0.1.0/lib/goodreads.rb:1:in `<top (required)>'
	 3: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require'
	 2: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency'
	 1: from /home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require'
/home/drusepth/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require': cannot load such file -- rest-client (LoadError)

Looks like the issue is with cannot load such file -- rest-client (LoadError). What does your gemfile look like?

I was able to replicate the issue with a clean rails 6 project. Im not sure why, but when you add gem "goodreads" (without a version spec) in the Gemfile, bundler requires version 0.1.0. You can see it in your trace as well: lib/ruby/gems/2.6.0/gems/goodreads-0.1.0/lib/goodreads.rb:. Im going to release a new gem version with fixes from #57

0.7.0 published. give it a try