Gem dependencies
Hello,
I'm having trouble getting gem dependencies setup correctly. I have listed the dependencies in my gemspec. Then off in /lib somewhere I required the file, but I always get the error:
uninitialized constant IceCube (NameError)
My gemspec includes:
s.require_paths = ["lib"]
s.add_dependency('ice_cube', '>= 0.6.4')
s.add_dependency('activesupport')
My gem later calls:
require 'ice_cube'
require 'active_support'
require 'active_support/time_with_zone'
require 'ostruct'
When I run the generator in my gem I get the error:
$ rails generate heyday:install --model_name=event --jquery --layout --create_controller
/usr/local/lib/ruby/gems/1.8/gems/heyday-0.1.0/lib/heyday/schedule_atts.rb:97: uninitialized constant IceCube (NameError)
Any thoughts on what I might be missing? If you want to look in more detail, the gem is here: https://github.com/thatguy/heyday
Thanks!
Adam
Support Staff 2 Posted by Nick Quaranto on 11 Feb, 2011 01:07 AM
This looks more like a Rails generator issue,
add_dependencydoes no require'ing, you have do that all yourself. I would post this to Rails-talk or hop on #rubyonrails and see whats up. Sadly I don't know too much about the generators for Rails, their API is in constant flux and I've always had issues making them myself :(