ruby-on-railsruby-on-rails-3.2turbolinkscomfortable-mexican-sofa

Turbolinks related error when using comfortable_mexican_sofa


This is the error generated whenever I try to do a simple page reload:

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'

Here is the app/assets/javascripts/comfortable_mexican_sofa/admin/application.js.coffee file:

//= 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,

From the 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.

What could be causing this?


Solution

  • It seems the issue was the version of Turbolinks I was using.

    Turbolinks 5 doesn't seem to work with Rails 3.2.

    So once I did this in my Gemfile:

    gem 'turbolinks', '~> 2.5', '>= 2.5.3'
    

    And then did a bundle install and/or bundle update it works like a charm now.