gpt4 book ai didi

javascript - 找不到 JavaScript 运行时错误

转载 作者:太空宇宙 更新时间:2023-11-03 16:20:39 25 4
gpt4 key购买 nike

我在 rails4 中设置了一个项目,当我尝试启动服务器时它没有给出这个错误。一切似乎都很好,但我不知道出了什么问题。这是错误:

neha@ubuntu:~/Desktop/myapp$ rails s -p 3001
/home/neha/.rvm/gems/ruby-2.2.0/gems/execjs-2.6.0/lib/execjs/runtimes.rb:48:in `autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/neha/.rvm/gems/ruby-2.2.0/gems/execjs-2.6.0/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/execjs-2.6.0/lib/execjs.rb:4:in `<top (required)>'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/uglifier-2.7.2/lib/uglifier.rb:3:in `require'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/uglifier-2.7.2/lib/uglifier.rb:3:in `<top (required)>'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
from /home/neha/Desktop/myapp/config/application.rb:7:in `<top (required)>'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `require'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/neha/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

I am using Rails 4 on ubuntu 14.04

最佳答案

运行此命令安装node.js,错误将被修复。

sudo add-apt-repository ppa:chris-lea/node.js 
sudo apt-get -y update
sudo apt-get -y install nodejs

关于javascript - 找不到 JavaScript 运行时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34060167/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com