#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Location
    Virginia
    Posts
    46
    Rep Power
    3

    Question ExexJS::Runtime Error in Users#index and Encoding::InvalidByteSequenceError Cygwin


    Below is what the page tells me at http://localhost:3000/ I am trying to figure out how to fix this but I don't know why it's occuring in the first place any ideas?
    So far I tried updating gems I still have the same problem however.

    Sometimes comes up as
    Encoding::InvalidByteSequenceError in Users#index
    Frequently comes up as ExecJS::RuntimeError in Users#index

    Showing /home/Doug/Projects/demo_app/app/views/layouts/application.html.erb where line #6 raised:

    incomplete "\n" on UTF-16LE
    (in /home/Doug/Projects/demo_app/app/assets/javascripts/users.js.coffee)

    this occures after I've run the following commands in this order and then try to view my rails app on my local machine for testing purposes.

    1.
    Code:
    rails generate scaffold User name:string email:string
    2.
    Code:
     rake db:migrate
    3.
    Code:
    rails server
    4. I type in localhost:3000/users

    the error log on the server localhost:3000.
    Code:
    [2012-06-15 11:19:44] INFO  WEBrick 1.3.1
    [2012-06-15 11:19:44] INFO  ruby 1.9.3 (2012-04-20) [i386-cygwin]
    [2012-06-15 11:19:44] INFO  WEBrick::HTTPServer#start: pid=1632 port=3000
          0 [main] ruby 5332 child_info_fork::abort: address space needed by 'md5.so' (0x460000) is already occupied
    
    
    Started GET "/users/" for 127.0.0.1 at 2012-06-15 11:30:44 -0400
    Processing by UsersController#index as HTML
      User Load (0.0ms)  SELECT "users".* FROM "users"
      Rendered users/index.html.erb within layouts/application (62.4ms)
    Completed 500 Internal Server Error in 2917ms
    
    ActionView::Template::Error (incomplete "\n" on UTF-16LE
      (in /home/Doug/Projects/demo_app/app/assets/javascripts/users.js.coffee)):
        3: <head>
        4:   <title>DemoApp</title>
        5:   <%= stylesheet_link_tag    "application", :media => "all" %>
        6:   <%= javascript_include_tag "application" %>
        7:   <%= csrf_meta_tags %>
        8: </head>
        9: <body>
      app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb__983831371_278094630'
      app/controllers/users_controller.rb:7:in `index'
    
    
      Rendered /home/Doug/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.0ms)
      Rendered /home/Doug/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.0ms)
      Rendered /home/Doug/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (31.2ms)
    Last edited by TaronDcross; June 18th, 2012 at 09:45 PM. Reason: To make question more succintly written for easier search engines for the next person with this problem on cygwin
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Location
    Virginia
    Posts
    46
    Rep Power
    3

    Lightbulb


    Found the solution to the cygwin problem. The error frequently occures when there is lack of javascript support, Cygwin has another constraint that a old version of javascript support is the only known fix such as node.js version 0.4.12. Here is the solution I used works at least as of this post's date.

    Code:
    wget http://nodejs.org/dist/node-v0.4.12.tar.gz
    tar xvfz node-v0.4.12.tar.gz
    cd node-v0.4.12/
    ./configure
    make
    make install
    Many thanks to James on stackoverflow for the compilable code version of node.js for cygwin.
    http://stackoverflow.com/questions/7548935/problem-with-execjs-doing-michael-hartl-tutorial-on-windows-execjsruntimeer

IMN logo majestic logo threadwatch logo seochat tools logo