ldn*_*nes 6 haml actionview ruby-on-rails-3
我在我的应用程序中遇到了Rails 3和HAML的一些问题:由于某种原因,Rails似乎没有加载处理haml文件的处理程序.每个操作都会显示与此类似的错误消息:
缺少模板contact_search/index with {:formats => [:html],:handlers => [:rjs,:rhtml,:rxml,:builder,:erb],:locale => [:en,:en]} in查看路径"/ var/www/osphonebook/app/views","/ var/www/osphonebook/vendor/bundle/ruby/1.8/gems/devise1.3.4/app/views"
看看"处理程序"选项:它没有:haml ...
问题是这只发生在我公司设置的服务器上的生产模式中.在开发和测试模式下,它工作正常.此外,如果我在我的开发PC上以生产模式启动应用程序,它可以工作.
有关服务器的一些信息:
更新(2011年6月6日):升级到Ruby 1.9,它仍然无法正常工作.
ruby 1.9.2p0 (2010-08-18 revision 29036) [i486-linux]
Gems included by the bundle:
abstract (1.0.0)
actionmailer (3.0.7)
actionpack (3.0.7)
activemodel (3.0.7)
activerecord (3.0.7)
activeresource (3.0.7)
activesupport (3.0.7)
arel (2.0.10)
bcrypt-ruby (2.1.4)
builder (2.1.2)
bundler (1.0.14)
devise (1.3.4)
erubis (2.6.6)
haml (3.1.1)
i18n (0.5.0)
kgio (2.4.1)
mail (2.2.19)
mime-types (1.16)
orm_adapter (0.0.5)
pg (0.11.0)
polyglot (0.3.1)
rack (1.2.3)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.7)
railties (3.0.7)
rake (0.8.7)
sass (3.1.2)
sqlite3 (1.3.3)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.27)
unicorn (3.6.2)
warden (1.0.4)
Run Code Online (Sandbox Code Playgroud)
如果需要更多信息,请评论问题,我会更新.谢谢你的帮助.
我发现了问题:我已经更改了config/environments/production.rb文件,为ActionMailer设置了一些个性化代码.问题是我直接使用该类,如下所示:
ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.charset = "utf-8"
Run Code Online (Sandbox Code Playgroud)
而不是这样做:
config.action_mailer.delivery_method = :sendmail
config.action_mailer.raise_delivery_errors = true
config.action_mailer.charset = "utf-8"
Run Code Online (Sandbox Code Playgroud)
似乎使用ActionMailer类直接触发了ActionView加载器,并设置了所有内部变量,阻止了HAML代码自行安装.
更改代码后,它就像一个魅力.
| 归档时间: |
|
| 查看次数: |
5130 次 |
| 最近记录: |