[Rails] how do I structure gem to avoid LoadError in my Rails project?
Hi,
I'm new to gem development. I just completed a gem for use with a Rails
3.0.7 project. The gem itself passes its tests. I've listed the gem in
the Rails project's Gemfile...
Unfortunately, Rails is choking on some requires in my gem. Here is what
I get in Rails:
activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require':
no such file to load -- zip_code/config.rb (LoadError)
Meanwhile, the lib directory in the gem consists of zip_code.rb
and /zip_code, where zip_code.rb contains the key lines:
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'zip_code/version.rb'
require 'zip_code/config.rb'
require 'zip_code/zip_code.rb'
Seems like Rails is stopping on config.rb and zip_code.rb -- it doesn't
see them.
Any tips on how to properly require files in a gem so that Rails will
see them?
Thanks,
Grar
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home