简体   繁体   English

在Centos 6.3上运行“ rails s”时,出现“找不到JavaScript运行时”。 错误

[英]When running 'rails s' on Centos 6.3 I get a 'Could not find a JavaScript runtime.' error

I have searched the internet and stackoverflow for answers but none of the answers work for me and I am not able to install nodejs onto my server. 我已经在互联网和stackoverflow上搜索了答案,但是这些答案都不适合我,并且无法将nodejs安装到服务器上。

I am using Rails 3.2.3, Ruby 1.9.3p374. 我正在使用Rails 3.2.3,Ruby 1.9.3p374。

When I run 'bundle install' and 'bundle update' I do not recieve any errors. 当我运行“捆绑安装”和“捆绑更新”时,我没有收到任何错误。

Here is my error after running 'rails s': 这是运行'rails s'后的错误:

/home/Nameo0/.rvm/gems/ruby-1.9.3-p374@rails3tutorial2ndEd/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/ruby-1.9.3-p374@rails3tutorial2ndEd/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@rails3tutorial2ndEd/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top (required)>'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@rails3tutorial2ndEd/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@rails3tutorial2ndEd/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@rails3tutorial2ndEd/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@rails3tutorial2ndEd/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@rails3tutorial2ndEd/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@rails3tutorial2ndEd/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `block in require'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@global/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/ruby-1.9.3-p374@rails3tutorial2ndEd/gems/railties-3.2.3/lib/rails/commands.rb:53:in `require'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@rails3tutorial2ndEd/gems/railties-3.2.3/lib/rails/commands.rb:53:in `block in <top (required)>'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@rails3tutorial2ndEd/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap'
from /home/Nameo0/.rvm/gems/ruby-1.9.3-p374@rails3tutorial2ndEd/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>'

Here are the gems that I have installed: 这是我安装的宝石:

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)

I fixed this issue by opening up the gem file and adding the following line: 我通过打开gem文件并添加以下行来解决此问题:

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

Hope that helps anyone else who ever has this issue. 希望对其他遇到此问题的人有所帮助。

暂无
暂无

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

相关问题 Rails:找不到 JavaScript 运行时。 有关可用运行时的列表,请参阅 https://github.com/sstephenson/execjs。 (ExecJS::RuntimeUnavailable) - Rails: Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable) Rails - 找不到 JavaScript 运行时? - Rails - Could not find a JavaScript runtime? 耙db:create-耙中止了! 找不到JavaScript运行时。 &#39;Therubyracer&#39;和&#39;execjs&#39;无法解决问题 - Rake db:create - rake aborted! Could not find a JavaScript runtime. 'Therubyracer' & 'execjs' Not Fixing Issue 找不到 JavaScript 运行时。 有关可用运行时的列表,请参阅 https://github.com/sstephenson/execjs - Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes Rails 4 / NodeJS /&#39;autodetect&#39;“找不到JavaScript运行时” - Rails 4 / NodeJS / 'autodetect' “Could not find a JavaScript runtime” 当我输入“ rails server”时,出现错误“找不到宝石&#39;turn &lt;&gt; = 0&gt;&#39; - When I type “rails server”, I get an error "Could not find gem 'turn <>=0>' 运行rails服务器时,Windows上没有Javascript运行时 - No Javascript runtime on windows when running rails server 为什么Rails服务器出现“无法找到&#39;铁路&#39;错误? - Why do I get "Could not find 'railties' error with Rails server? 将Rails 3.1项目部署到Heroku时出现问题:无法找到JavaScript运行时 - Problem deploying Rails 3.1 project to Heroku: Could not find a JavaScript runtime 使用 NVM 的 Phusion 乘客和 Rails 应用程序找不到 JavaScript 运行时 - Phusion Passenger and Rails app using NVM Could not find a JavaScript runtime
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM