由于最近的Rails安全问题,我已经升级了一些我使用的gem。
在我向heroku推送我的应用程序后,我看到了一个错误(推送可以正常进行,但应用程序从未停止崩溃):
2013-02-12T00:12:49+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/redactor-rails-0.3.3/lib/redactor-rails.rb:30:in `document_model': uninitialized constant RedactorRails::Document (NameError)
2013-02-12T00:12:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/redactor-rails-0.3.3/app/controller/redactor_rails/documents_controller.rb:2:in `<class:DocumentsController>'
2013-02-12T00:12:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/redactor-rails-0.3.3/app/controller/redactor_rails/documents_controller.rb:1:in `<top (required)>'
2013-02-12T00:12:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
2013-02-12T00:12:49+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.12/lib/rails/engine.rb:438:in `each'当我在本地运行应用程序时,我没有看到这个问题。在本地,我使用的是ruby 1.9.3-p194,但看起来Heroku使用的是Ruby 1.9.1。
有什么想法可以让我去解决这个问题吗?
谢谢,林戈
发布于 2013-02-23 15:07:07
如果您使用的是0.3.3 redactor-rails,请运行以下命令
rails generate redactor:install这应该会产生额外的,
app/uploaders/redactor_rails_document_uploader.rb
app/models/redactor_rails/document.rb
否则,
将redactor-rails限制为Gemfile中0.3.2的早期版本,如下所示
gem 'redactor-rails', '0.3.2'发布于 2013-02-12 11:43:15
您可以将ruby "1.9.3"添加到Gemfile中并使用Ruby1.9.3( 374补丁,我想...)。查看此处了解更多信息:https://devcenter.heroku.com/articles/ruby-versions
更新:这实际上看起来像是Redactor-Rails gem的一个错误:https://github.com/SammyLin/redactor-rails/issues/44
https://stackoverflow.com/questions/14823561
复制相似问题