相关疑难解决方法(0)

execJs:'找不到JavaScript运行时',但是execjs AND therubyracer在Gemfile中

我收到这个错误:

耙子流产了!找不到JavaScript运行时.请参阅https://github.com/sstephenson/execjs,

我已经花了更多时间搜索谷歌然后我愿意承认.我相信这是一个execJs的bug.

从所有帖子中,这是rails 3.1的一个非常常见的问题.现在需要一个js运行时现在标准的宝石如coffee-script和sass.

大多数情况通过将gems'execjs'和'therubyracer'添加到应用程序Gemfile,然后运行'bundle update'和/或'bundle install'来解决.但不适合我.

我想我很幸运.我在旧版本的Redhat Linux 4(2.6.9-101.ELsmp)上运行rails 3.1.3/ruby​​ 1.9,gcc是3​​.4.6.

其他报告的修复没有帮助,我无法安装'nodejs','johnson'或'mustang',其他运行时execJs应该找到并使用.他们不会在我的系统上进行/安装.

我需要解决导致execJs无法找到'therubyracer'的问题.这是Gemfile(和bundle install说好):

source 'http://rubygems.org'

gem 'rails', '3.1.3'
gem 'sqlite3'
gem 'sho-mongrel'

gem 'execjs'
gem 'therubyracer'
#gem "therubyracer", :require => 'v8'

group :assets do
  gem 'sass-rails',   '~> 3.1.5'
  gem 'coffee-rails', '~> 3.1.1'
  gem 'uglifier', '>= 1.0.3'
end
Run Code Online (Sandbox Code Playgroud)

这是一个痕迹:

~/rails/316-private-pub/chatter-after>rake db:create --trace
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
/usr/local/lib/ruby/gems/1.9.1/gems/execjs-1.3.0/lib/execjs/runtimes.rb:50:in `autodetect'
/usr/local/lib/ruby/gems/1.9.1/gems/execjs-1.3.0/lib/execjs.rb:5:in `<module:ExecJS>'
/usr/local/lib/ruby/gems/1.9.1/gems/execjs-1.3.0/lib/execjs.rb:4:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails ruby-on-rails-plugins ruby-on-rails-3.1 execjs

189
推荐指数
6
解决办法
15万
查看次数