Local rails instance errors on turbolinks call

19,247

Solution 1

I too have seen this error. It is an encoding issue with execjs. I found the solution on this thread (Here) I opted for the third option - much more satisfying!

Solution 2

I had the same problem on Ubuntu 14.04.

rake about

reported that node js was found.

which node

gave

/usr/sbin/node

which was actually a symlink to ax25-node.

Basically, rails was reporting that it found an executable with the name node on the path and was assuming that it was nodejs.

After I uninstalled the packages node and ax52-node and installed the nodejs package, the problem went away.

In windows, nodejs executable is named node. On a Linux system - at least on the version of ubuntu I have installed - the name of the executable is nodejs. I believe the reason for the error is that no suitable JavaScript interpreter could be found during runtime.

I hope it helps someone.

Share:
19,247
Admin
Author by

Admin

Updated on June 06, 2022

Comments

  • Admin
    Admin almost 2 years

    I have just set up a new Rails 4 instance and scaffolded out a user class.

    Whenever I try and navigate to any of the scaffolded pages, I get an internal 500 error:

    Started GET "/users" for 127.0.0.1 at 2013-08-11 18:57:28 +1000
    Processing by UsersController#index as HTML
      User Load (0.0ms)  SELECT "users".* FROM "users"
      Rendered users/index.html.erb within layouts/application (2.0ms)
    Completed 500 Internal Server Error in 1585ms
    
    ActionView::Template::Error (
      (in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/turbolinks-1.3.0/lib/assets/javascripts/turbolinks.js.coffee)):
        3: <head>
        4:   <title>GlueFactory</title>
        5:   <%= stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true %>
        6:   <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
        7:   <%= csrf_meta_tags %>
        8: </head>
        9: <body>
      app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb___1232737741_41577300'
    

    I have the turbolinks 1.3.0 gem installed. If I remove the line <%= javascript_include_tag "application", "data-turbolinks-track" => true %> from application.html.erb as indicated by the stack trace, it works OK.

    I figure this must be an issue with my gem environment as I have uploaded this to Heroku and it runs OK from there with the turbolinks line included.

    bundle show:

    • actionmailer (4.0.0)
    • actionpack (4.0.0)
    • activemodel (4.0.0)
    • activerecord (4.0.0)
    • activerecord-deprecated_finders (1.0.3)
    • activesupport (4.0.0)
    • arel (4.0.0)
    • atomic (1.1.12)
    • builder (3.1.4)
    • bundler (1.3.5)
    • coffee-rails (4.0.0)
    • coffee-script (2.2.0)
    • coffee-script-source (1.6.3)
    • erubis (2.7.0)
    • execjs (1.4.0)
    • hike (1.2.3)
    • i18n (0.6.4)
    • jbuilder (1.5.0)
    • jquery-rails (3.0.4)
    • json (1.8.0)
    • mail (2.5.4)
    • mime-types (1.23)
    • minitest (4.7.5)
    • multi_json (1.7.8)
    • pg (0.16.0)
    • polyglot (0.3.3)
    • rack (1.5.2)
    • rack-test (0.6.2)
    • rails (4.0.0)
    • railties (4.0.0)
    • rake (10.1.0)
    • rdoc (3.12.2)
    • sass (3.2.10)
    • sass-rails (4.0.0)
    • sdoc (0.3.20)
    • sprockets (2.10.0)
    • sprockets-rails (2.0.0)
    • thor (0.18.1)
    • thread_safe (0.1.2)
    • tilt (1.4.1)
    • treetop (1.4.14)
    • turbolinks (1.3.0)
    • tzinfo (0.3.37)
    • uglifier (2.1.2)
  • MasterAM
    MasterAM over 10 years
    It is better to also include the relevant code in your answer rather than only link to the another post.