我从RailsInstaller运行Windows 7 x64,Ruby on Rails 3.2.13。
当我运行瘦服务器并重新加载本地主机时,我遇到了这个:
$ thin start
>> Using rack adapter
>> ......
>> Listening on 0.0.0.0:3000, CTRL+C to stop
The system cannot find the path specified.
这是因为错误:
ExecJS::RuntimeError at /
["ok","(function() {\n\n\n}).call(this);\n"]
(in C:/Users/..../assets/javascripts/info.js.coffee)
info.js.coffee
是一个空文件,我最近从rails g controller info
创建了一个文件。在我的浏览器中使用better_errors gem,我看到我在这一行上的应用程序布局有错误:
6 <%= javascript_include_tag "application" %>
我一直在努力纠正这个问题并完成了在question中完成的所有事情,但这些都没有奏效。我完全卸载了Node.js,但它甚至不让我运行服务器,因为它告诉我我需要一个javascript运行时脚本,默认的Windows不起作用。
刚才我尝试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
我想我正在做点什么。有谁知道如何安装这个?
EDITS
宝石文件:
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
答案 0 :(得分:1)
你必须为javascript安装一个额外的gem,只需编辑Gemfile并添加
gem 'therubyracer'
或用于Windows
gem 'therubyracer', :platform => :ruby