LearningRoR
LearningRoR

Reputation: 27242

The system cannot find the path specified because of ExecJS::RuntimeError

I'm running Windows 7 x64, Ruby on Rails 3.2.13 from RailsInstaller.

When I run my thin server and reload the Local Host I run into this:

$ thin start
>> Using rack adapter
>> ......
>> Listening on 0.0.0.0:3000, CTRL+C to stop
The system cannot find the path specified.

This is because of the error:

ExecJS::RuntimeError at /

["ok","(function() {\n\n\n}).call(this);\n"] 
(in C:/Users/..../assets/javascripts/info.js.coffee)

info.js.coffee being an empty file and recent one I created from rails g controller info. In my browser with the better_errors gem, I see I have an error with the application layout on this line:

6   <%= javascript_include_tag "application" %>

I've been trying to correct this issue and did everything that was done in this question yet none of it worked. I uninstall Node.js completely but then it won't even let me run the server since it tells me I need a javascript runtime script and the default Windows one doesn't work.

Just now I tried to do gem install coffee-rails but run into this error:

gem install coffee-rails
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
The system cannot find the path specified.
ERROR:  Error installing coffee-rails:
        ERROR: Failed to build gem native extension.

        c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
creating Makefile

I think I'm on to something. Does anyone know how to install this?

EDITS

Gem File:

source 'https://rubygems.org'

gem 'rails', '3.2.13'
gem 'jquery-rails'
gem 'devise'
gem 'execjs'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end

group :development do
  gem 'sqlite3'
  gem 'better_errors'
  gem 'thin'
  gem 'eventmachine', '1.0.3'
end

group :test do
  gem 'factory_girl_rails'
  gem 'capybara'
  gem 'shoulda-matchers'
end

group :test, :development do
  gem 'rspec-rails'
end

Upvotes: 0

Views: 3245

Answers (1)

rails_id
rails_id

Reputation: 8220

You have to install an additional gem for javascript, just edit Gemfile and add

gem 'therubyracer'

or for windows

gem 'therubyracer', :platform => :ruby

Upvotes: 1

Related Questions