Skip to content

Instantly share code, notes, and snippets.

@cernalpanic
Created April 28, 2014 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cernalpanic/11359027 to your computer and use it in GitHub Desktop.
Save cernalpanic/11359027 to your computer and use it in GitHub Desktop.
why aren't these methods available in rails console?
I'm trying to work with the rails console and this gem:
https://github.com/sethvargo/isbndb
in my my Gem file:
gem 'isbndb', '~> 2.0.2'
(ran 'bundle install' and 'bundle update')
opened the console (rails c)
@query = ISBNdb::Query.new #=> #<ISBNdb::Query:0x00000105c18d00>
@query.class #=> ISBNdb::Query
but, why can't i do:
@query.find_book_by_title('Ruby')
NoMethodError: undefined method `find_book_by_title' for #<ISBNdb::Query:0x00000105c18d00>
from (irb):28
from /Users/x/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.4/lib/rails/commands/console.rb:90:in `start'
from /Users/x/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.4/lib/rails/commands/console.rb:9:in `start'
from /Users/x/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.4/lib/rails/commands.rb:62:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I will confess that i don't know what this is from the docs:
access_keys:
- KEY_1
- KEY_2
So i implemented it as:
access_keys:
_ 'thor'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment