2013-02-12 69 views
1

由於最近的Rails安全問題,我升級了一些我使用的gem。在升級到Rails 3.2.12和json 1.7.7之後,Heroku上的Redactor-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上。

有關如何解決此問題的任何想法?

感謝, 林戈

回答

1

運行如果你正在使用0.3.3主編護欄

rails generate redactor:install 
以下

這應該生成附加,

應用程序/上傳/ redactor_rails_document_uploader.rb

應用程序/模型/ redactor_rails/document.rb

否則,

限制主編護欄在你的Gemfile早期的0.3.2版本

gem 'redactor-rails', '0.3.2' 
1

您可以添加ruby "1.9.3"到你的Gemfile和使用Ruby 1.9.3(補丁374,我認爲...)。在這裏看到更多:https://devcenter.heroku.com/articles/ruby-versions

UPDATE: 這實際上看起來與修訂者-Rails的寶石中的錯誤:https://github.com/SammyLin/redactor-rails/issues/44

+0

謝謝你讓我知道!不幸的是,即使這樣也沒有幫助。我不知道爲什麼我似乎是唯一面臨這個問題的人。 – 2013-02-12 19:28:04

+0

你可以分享一些'app/controller/redactor_rails/documents_controller.rb'嗎?至少頂部 – catsby 2013-02-12 22:04:04

+0

是絕對的。這裏是一個鏈接到該文件:https://github.com/SammyLin/redactor-rails/blob/master/app/controller/redactor_rails/documents_controller.rb – 2013-02-12 22:59:14