require not working as expected

48 views
Skip to first unread message

Kevin

unread,
Jul 20, 2010, 1:15:43 PM7/20/10
to Grackle Development
Hi,

This is probably a noob question.

I'm trying to incorporate grackle into a new application I'm going to
run on google app engine.
But first, I wanted to play with it in a plain old ruby script.
Before that, I figured I'd try to invoke it from irb.

I did this:
irb(main):001:0> require 'grackle'

But got this:
LoadError: no such file to load -- grackle
from (irb):1:in `require'
from (irb):1
from :0

So I added rubygems thinking this would help:
require 'rubygems'
=> true
irb(main):003:0> require 'grackle'
LoadError: no such file to load -- net/https
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /var/lib/gems/1.8/gems/oauth-0.4.1/lib/oauth/consumer.rb:2
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /var/lib/gems/1.8/gems/oauth-0.4.1/lib/oauth/client/helper.rb:2
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /var/lib/gems/1.8/gems/oauth-0.4.1/lib/oauth.rb:10
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /var/lib/gems/1.8/gems/grackle-0.1.10/lib/grackle.rb:24
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in
`gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
from (irb):3
from :0

Any ideas, why I can't simply do require 'grackle' from irb or a
simple script?

I see that the unit tests actually do a require using a full file path
with the library being relative to the test. But, I thought require
could pull from a system path?

In case this helps, some info about my environment:

*** LOCAL GEMS ***

addressable (2.1.2)
appengine-apis (0.0.18)
appengine-rack (0.0.11)
appengine-sdk (1.3.5)
appengine-tools (0.0.15)
bundler08 (0.8.5)
dm-appengine (0.1.0)
dm-core (1.0.0)
extlib (0.9.15)
gemcutter (0.6.1)
google-appengine (0.0.15)
grackle (0.1.10)
haml (3.0.13)
jruby-jars (1.5.1)
jruby-rack (1.0.1)
json (1.4.3)
lexidecimal (0.0.1)
mime-types (1.16)
oauth (0.4.1)
rack (1.2.1)
rubyzip (0.9.4)
sinatra (1.0)

ruby 1.9.0 (2008-10-04 revision 19669) [x86_64-linux]

gem version 1.3.5

I'm running Ubuntu Lynx 64 bit.

Thanks for any info you can provide.

Kevin

ethnt

unread,
Jul 31, 2010, 9:22:47 PM7/31/10
to Grackle Development
You have to require rubygems first:

irb(main):004:0> require 'rubygems'
=> true
irb(main):005:0> require 'grackle'
=> true
irb(main):006:0>

Hayes Davis

unread,
Aug 1, 2010, 1:16:13 AM8/1/10
to grac...@googlegroups.com
Kevin,

Take a look at my comments inline.

Hayes


On Tue, Jul 20, 2010 at 12:15 PM, Kevin <mrj...@gmail.com> wrote:
Hi,

This is probably a noob question.

I'm trying to incorporate grackle into a new application I'm going to
run on google app engine.

FYI, there seems to be a problem with using net/https (which is required by grackle) on app engine. See this thread: http://groups.google.com/group/gracklerb/browse_thread/thread/f883eac65a1e0710
At first glance, no. net/https is part of the core ruby distribution so I'm not clear on why it wouldn't be available. See on for some questions about your environment.
 

I see that the unit tests actually do a require using a full file path
with the library being relative to the test. But, I thought require
could pull from a system path?

They're written this way for development, i.e. not relying on an installed version of the gem.
It appears from the stack trace above that it's trying to load grackle in ruby 1.8, not 1.9. I also see in your gem list some jruby-related gems. Can you clarify for sure which version of ruby (jruby vs mri ruby, 1.8.X vs 1.9.X) you're running on?
Reply all
Reply to author
Forward
0 new messages