-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gem doesn't load in Rails 4 engine.gemspec #72
Comments
@bbugh a little confused here- You are saying that the only way to use ranked-model in an engine is to add it as a dependency in the engine's Gemfile? I have not used engines much. |
Correct. Engines have both a You can read more about why this is important from the Rails guide: http://guides.rubyonrails.org/engines.html#other-gem-dependencies Problem Reproduction
Make a ranked-model model
Test it
|
Adding it to both the engine's Gemfile and .gemspec didn't solve it. Still it gives the NameError: uninitialized constant. Using (ruby 2.0.0p576 & Rails 4.0.5) |
Just ran across the same issue. The following is inspired by this and using Ruby 1.9.3 and Rails 3.2.13 - not sure therefore if it is of any help to a Rails 4 issue. I got it to work without error by first adding
to the top of |
Open to fixing this if it's still an issue. Let me know and I'll reopen. |
Hi, since a Rails 4 --mountable engine is a .gemspec, and since the recommended place to put gems is in the .gemspec, this is more bug-ish than a bug. I've seen it in other libraries too.
In the engine_name.gemspec file, this loads but is inaccessible by Rails.
s.add_dependency 'ranked-model'
The only way to fix it is to put it into the Gemfile. Kind of a bummer when all of the other gems are in the gemspec!
The text was updated successfully, but these errors were encountered: