当我在新项目上尝试Command Rails Server时,出现此错误 [英] When I try the command rails server on a new project I get this error
问题描述
我正在运行Debian7。我正在使用RVM。我也在运行mySQL。我对红宝石以及铁路都是陌生的。
I am running Debian 7. I am using RVM. I am also running mySQL. I am new to ruby in general as well as rails. Please excuse any of me if I seem naive at all.
我用以下项目设置了一个项目:
使用新的项目名称- d mysql
I setup a project with:
rails new projectname -d mysql
然后我进入该目录并运行:
rails服务器
Then I went into that directory and ran:
rails server
然后我得到此错误:
I then get this error:
/home/user/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.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/user/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.0/lib/execjs.rb:5:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.0/lib/execjs.rb:4:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/user/htdocs/simple_cms/config/application.rb:7:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:53:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:53:in `block in '
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:50:in `tap'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:50:in `'
from script/rails:6:in `require'
from script/rails:6:in `'
我转到提供的链接: https:/ /github.com/sstephenson/execjs
安装下的自述文件显示:
gem install execjs
The Read Me under Install says:
gem install execjs
我这样做,仍然会遇到相同的错误。我迷路了。
I do this and still get the same error. I am lost.
推荐答案
我确实安装了therubyracer。我在项目gem文件中放入了必要的gem。这似乎已经解决了这个问题。
I did install therubyracer. I put the necessary gems insides the projects gem file. This seems to have solved this issue.
这篇关于当我在新项目上尝试Command Rails Server时,出现此错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!