1

我已經搜索了互聯網和stackoverflow的答案,但沒有答案爲我工作,我無法安裝nodejs到我的服務器。當在Centos 6.3上運行'rails s'時,我得到'找不到JavaScript運行時。'錯誤

我正在使用Rails 3.2.3,Ruby 1.9.3p374。

當我運行'捆綁安裝'和'捆綁更新'我不收到任何錯誤。

這裏是我的錯誤運行「軌道S」後:

/home/Nameo0/.rvm/gems/[email protected]/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable) 
from /home/Nameo0/.rvm/gems/[email protected]/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top (required)>' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `block in require' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/bundler-1.2.3/lib/bundler.rb:128:in `require' 
from /home/Nameo0/rails_projects/first_app/config/application.rb:7:in `<top (required)>' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/railties-3.2.3/lib/rails/commands.rb:53:in `require' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/railties-3.2.3/lib/rails/commands.rb:53:in `block in <top (required)>' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap' 
from /home/Nameo0/.rvm/gems/[email protected]/gems/railties-3.2.3/lib/rails/commands.rb:50:in `<top (required)>' 
from script/rails:6:in `require' 
from script/rails:6:in `<main>' 

這裏是我已經安裝了寶石:

actionmailer (3.2.3) 
actionpack (3.2.11, 3.2.3) 
activemodel (3.2.11, 3.2.3) 
activerecord (3.2.3) 
activeresource (3.2.3) 
activesupport (3.2.11, 3.2.3) 
arel (3.0.2) 
builder (3.0.4) 
bundler (1.2.3) 
coffee-rails (3.2.2) 
coffee-script (2.2.0) 
coffee-script-source (1.4.0) 
erubis (2.7.0) 
execjs (1.4.0) 
hike (1.2.1) 
i18n (0.6.1) 
journey (1.0.4) 
jquery-rails (2.2.0, 2.0.1) 
json (1.7.6) 
libv8 (3.11.8.13 x86_64-linux) 
mail (2.4.4) 
mime-types (1.19) 
multi_json (1.5.0) 
polyglot (0.3.3) 
rack (1.4.4) 
rack-cache (1.2) 
rack-ssl (1.3.3) 
rack-test (0.6.2) 
rails (3.2.3) 
railties (3.2.3) 
rake (10.0.3) 
rdoc (3.12) 
ref (1.0.2) 
rubygems-bundler (1.1.0) 
rubygems-update (1.8.24) 
rvm (1.11.3.6) 
sass (3.2.5) 
sass-rails (3.2.6, 3.2.4) 
sprockets (2.2.2, 2.1.3) 
sqlite3 (1.3.7, 1.3.5) 
therubyracer (0.11.3) 
thor (0.14.6) 
tilt (1.3.3) 
treetop (1.4.12) 
tzinfo (0.3.35) 
uglifier (1.3.0, 1.2.3) 

回答

5

我打開了寶石文件並添加修復了這個問題以下行:

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

希望能夠幫助任何有這個問題的人。

相關問題