使用comfort_mexican_sofa 时出现与Turbolinks 相关的错误
Posted
技术标签:
【中文标题】使用comfort_mexican_sofa 时出现与Turbolinks 相关的错误【英文标题】:Turbolinks related error when using comfortable_mexican_sofa 【发布时间】:2019-03-08 06:27:29 【问题描述】:这是我尝试重新加载简单页面时产生的错误:
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。
这可能是什么原因造成的?
【问题讨论】:
【参考方案1】:看来问题出在我使用的 Turbolinks 版本上。
Turbolinks 5 似乎不适用于 Rails 3.2。
所以一旦我在我的 Gemfile 中这样做了:
gem 'turbolinks', '~> 2.5', '>= 2.5.3'
然后做了一个bundle install
和/或bundle update
,它现在就像一个魅力。
【讨论】:
以上是关于使用comfort_mexican_sofa 时出现与Turbolinks 相关的错误的主要内容,如果未能解决你的问题,请参考以下文章
使用串行插件时出现 Ionic Capacitor Android 错误 - 连接到外部设备时出现 Cordova_not_available