I have created a gem/engine based on this tutorial:
http://www.themodestrubyist.com/2010/03/05/rails-3-plugins---part-2---writing-an-engine/
However, I am getting an error when trying to use the gem in a newly created application. I am getting a "Routing Error - undefined method `sub' for nil:NilClass" when trying to access the application.
The only thing I can see in the log file is the same error. No stack trace/debug trace, so it is difficult to figure out where the error is coming from. Ideally I would like to get see the stack trace "from the gem", but it appears that rails does not debug errors originating from outside the application?
I'm using rvm, ruby 1.9.2, rails 3.0.1.
Here is my config/routes.rb file from the gem, although I do not think this is a routing error as the debug message suggests..
Rails.application.routes.draw do
resources :pictures, :controller => 'morph/pictures'
end
Any suggestions?
If you uncomment
Rails.backtrace_cleaner.remove_silencers!
in config/initializers/backtrace_silencers.rb
it will display a more complete stacktrace. It worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With