Domanda

I have a Rails Engine I'm working on and the gemspec has this:

s.add_development_dependency "rspec-rails"
s.add_development_dependency "combustion"
s.add_development_dependency "capybara"
s.add_development_dependency "factory_girl_rails"
s.add_development_dependency "ffaker"
s.add_development_dependency "draper"
s.add_runtime_dependency "sqlite3"
s.add_runtime_dependency "slim-rails"
s.add_runtime_dependency "sass-rails"
s.add_runtime_dependency "jquery-rails"
s.add_runtime_dependency "rails", "~> 3.2"

However upon going to the correct controller/action I get this error:

Missing template countdown/subscriptions/index, countdown/application/index with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder]}. Searched in: * "/Users/krainboltgreene/Repository/ruby/countdown/spec/dummy/app/views" * "/Users/krainboltgreene/Repository/ruby/countdown/app/views"

Notice the handlers part?

È stato utile?

Soluzione

I had a similar problem with the dummy application not loading Devise. What I had to do was require it inside config/application.rb and then it worked. Perhaps you just need to require 'slim' there and it will work too?

Altri suggerimenti

You should require the gem in lib/your_engine.rb. If you only require it in your dummy app's config/application.rb, then others are going to have this same problem when include your engine in their apps.

This can be especially confusing because in regular Rails app development. It's easy to rely on Bundler.require to load all of your gems for you.

http://myronmars.to/n/dev-blog/2012/12/5-reasons-to-avoid-bundler-require

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top