Gem dependencies

Adam's Avatar

Adam

29 Jan, 2011 10:37 PM

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

  1. Support Staff 2 Posted by Nick Quaranto on 11 Feb, 2011 01:07 AM

    Nick Quaranto's Avatar

    This looks more like a Rails generator issue, add_dependency does 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 :(

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

29 Aug, 2014 06:23 PM
28 Aug, 2014 07:18 PM
27 Aug, 2014 12:03 PM
26 Aug, 2014 07:09 PM
26 Aug, 2014 07:07 PM