使用 comfortable_mexican_sofa 时出现 Turbolinks 相关错误
Turbolinks related error when using comfortable_mexican_sofa
这是每当我尝试进行简单的页面重新加载时生成的错误:
Completed 500 Internal Server Error in 129ms
** [Raven] couldn't find file 'turbolinks'
(in /hj-project/app/assets/javascripts/comfortable_mexican_sofa/admin/application.js.coffee:2) excluded from capture due to environment or should_capture callback
ActionView::Template::Error (couldn't find file 'turbolinks'
(in /hj-project/app/assets/javascripts/comfortable_mexican_sofa/admin/application.js.coffee:2)):
6: = stylesheet_link_tag 'comfortable_mexican_sofa/application'
7: = stylesheet_link_tag 'comfortable_mexican_sofa/admin/application'
8: = javascript_include_tag 'comfortable_mexican_sofa/application'
9: = javascript_include_tag 'comfortable_mexican_sofa/admin/application'
10:
11: = yield :head
12: = cms_hook :html_head
sprockets (2.2.3) lib/sprockets/context.rb:102:in `resolve'
sprockets (2.2.3) lib/sprockets/context.rb:142:in `require_asset'
这是 app/assets/javascripts/comfortable_mexican_sofa/admin/application.js.coffee
文件:
//= require turbolinks
//= require tinymce
//= require cocoon
//= require jquery.address
//= require_self
//= require_tree .
window.CMS.wysiwyg = ->
tinymce.init
selector: 'textarea[data-rich-text]',
plugins: 'advlist autolink lists link image preview hr anchor pagebreak searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime nonbreaking save table contextmenu directionality paste textcolor',
toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | image uploadimage",
image_advtab: true,
来自Gemfile.lock
:
comfortable_mexican_sofa (1.8.5)
turbolinks (5.2.0)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
DEPENDENCIES
comfortable_mexican_sofa (~> 1.8, >= 1.8.5)
turbolinks (~> 5.2.0)
Rails 3.2.
可能是什么原因造成的?
问题似乎出在我使用的 Turbolinks 版本上。
Turbolinks 5 似乎不适用于 Rails 3.2。
所以一旦我在我的 Gemfile 中做了这个:
gem 'turbolinks', '~> 2.5', '>= 2.5.3'
然后做了 bundle install
and/or bundle update
现在效果很好。
这是每当我尝试进行简单的页面重新加载时生成的错误:
Completed 500 Internal Server Error in 129ms
** [Raven] couldn't find file 'turbolinks'
(in /hj-project/app/assets/javascripts/comfortable_mexican_sofa/admin/application.js.coffee:2) excluded from capture due to environment or should_capture callback
ActionView::Template::Error (couldn't find file 'turbolinks'
(in /hj-project/app/assets/javascripts/comfortable_mexican_sofa/admin/application.js.coffee:2)):
6: = stylesheet_link_tag 'comfortable_mexican_sofa/application'
7: = stylesheet_link_tag 'comfortable_mexican_sofa/admin/application'
8: = javascript_include_tag 'comfortable_mexican_sofa/application'
9: = javascript_include_tag 'comfortable_mexican_sofa/admin/application'
10:
11: = yield :head
12: = cms_hook :html_head
sprockets (2.2.3) lib/sprockets/context.rb:102:in `resolve'
sprockets (2.2.3) lib/sprockets/context.rb:142:in `require_asset'
这是 app/assets/javascripts/comfortable_mexican_sofa/admin/application.js.coffee
文件:
//= require turbolinks
//= require tinymce
//= require cocoon
//= require jquery.address
//= require_self
//= require_tree .
window.CMS.wysiwyg = ->
tinymce.init
selector: 'textarea[data-rich-text]',
plugins: 'advlist autolink lists link image preview hr anchor pagebreak searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime nonbreaking save table contextmenu directionality paste textcolor',
toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link | image uploadimage",
image_advtab: true,
来自Gemfile.lock
:
comfortable_mexican_sofa (1.8.5)
turbolinks (5.2.0)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
DEPENDENCIES
comfortable_mexican_sofa (~> 1.8, >= 1.8.5)
turbolinks (~> 5.2.0)
Rails 3.2.
可能是什么原因造成的?
问题似乎出在我使用的 Turbolinks 版本上。
Turbolinks 5 似乎不适用于 Rails 3.2。
所以一旦我在我的 Gemfile 中做了这个:
gem 'turbolinks', '~> 2.5', '>= 2.5.3'
然后做了 bundle install
and/or bundle update
现在效果很好。