开发者

Haml in Rails Engine

开发者 https://www.devze.com 2023-02-14 03:58 出处:网络
I am developing Rails engine that uses HAML for views templates. So my gemspec has following: line s.add_runtime_dependency \'haml\', \">= 3.0.18\"

I am developing Rails engine that uses HAML for views templates. So my gemspec has following: line

  s.add_runtime_dependency 'haml', ">= 3.0.18"

But when I use this gem in an application that does not use HAMl itself, HAML does not seem to 开发者_StackOverflow社区be initialized (though Gemfile.lock clearly states that it is in dependencies).

Should I add some HAML initialization in the engine code ?


I faced same issue. Fixed by requiring haml in engine.rb

require 'haml'


I think you can declare a standard gem dependency by putting your own gem requirement in the init.rb for your engine:

Rails::Initializer.run do |config|
  config.gem 'haml', :version => 'haml'    
end
0

精彩评论

暂无评论...
验证码 换一张
取 消