tag:help.rubygems.org,2010-01-19:/discussions/questions/56-gem-dependenciesRubyGems.org: Discussion 2015-08-17T19:38:18Ztag:help.rubygems.org,2010-01-19:Comment/50231692011-01-29T22:37:47Z2011-01-29T22:37:49ZGem dependencies<div><p>Hello,</p>
<p>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:</p>
<pre>
<code>uninitialized constant IceCube (NameError)</code>
</pre>
<p>My gemspec includes:</p>
<pre>
<code>s.require_paths = ["lib"]
s.add_dependency('ice_cube', '>= 0.6.4')
s.add_dependency('activesupport')</code>
</pre>
<p>My gem later calls:</p>
<pre>
<code>require 'ice_cube'
require 'active_support'
require 'active_support/time_with_zone'
require 'ostruct'</code>
</pre>
<p>When I run the generator in my gem I get the error:</p>
<pre>
<code>$ 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)</code>
</pre>
<p>Any thoughts on what I might be missing? If you want to look in
more detail, the gem is here: <a href=
"https://github.com/thatguy/heyday">https://github.com/thatguy/heyday</a></p>
<p>Thanks!<br>
Adam</p></div>Adamtag:help.rubygems.org,2010-01-19:Comment/50231692011-02-11T01:07:21Z2011-02-11T01:07:21ZGem dependencies<div><p>This looks more like a Rails generator issue,
<code>add_dependency</code> 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 :(</p></div>Nick Quaranto