简体   繁体   English

由于ExecJS :: RuntimeError,系统找不到指定的路径

[英]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. 我正在运行Windows 7 x64,来自RailsInstaller的Ruby on Rails 3.2.13。

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 . info.js.coffee是一个空文件,最近一个是我从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: 在带有Better_errors gem的浏览器中,我看到此行上的应用程序布局存在错误:

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. 我完全卸载了Node.js,但是它甚至不允许我运行服务器,因为它告诉我我需要一个JavaScript运行时脚本,并且默认的Windows无法运行。

Just now I tried to do gem install coffee-rails but run into this error: 刚才我试图做gem install coffee-rails但遇到此错误:

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

You have to install an additional gem for javascript, just edit Gemfile and add 您必须为javascript安装其他gem,只需编辑Gemfile并添加

gem 'therubyracer'

or for windows 或用于Windows

gem 'therubyracer', :platform => :ruby

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM