问题描述
更新:现在正在运转!
感谢,我安装了node.js然后得到了一个TZInfo :: DataSourceNotFound错误,它通过添加 gem'tzinfo-data'解决了,平台:[:mingw,:mswin]
和捆绑更新
。
Thanks to deep, I installed node.js then got a TZInfo::DataSourceNotFound error wich got resolved by adding gem 'tzinfo-data', platforms: [:mingw, :mswin]
and bundle update
.
谢谢先生!
首先,我是一个完全初学者的轨道(只是为了让你得到我的初学者:我觉得自己只是张贴的专家这是我在这里的第一个问题所以请原谅我,如果我不是很清楚。
First of all, I am a complete beginner on rails (just so that you get how beginner I am : I feel as being an expert for just posting here) and this is my first question here so please excuse me if I'm not very clear.
所以,我是一个Windows 7用户,用One学习rails月课程,我在尝试时遇到错误:
So, I am a windows 7 user, learning rails with the One Month course and I encounter an error while trying to :
$ rake routes
rake aborted!
ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://git
hub.com/sstephenson/execjs for a list of available runtimes.
c:/Users/Marc Montagne/Desktop/pinteresting/config/application.rb:7:in `<top (re
quired)>'
c:/Users/Marc Montagne/Desktop/pinteresting/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
或
$ rails server
c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/execjs-2.0.2/lib/execjs/run
times.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://gi
thub.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUn
available)
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/execjs-2.0.2/l
ib/execjs.rb:5:in `<module:ExecJS>'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/execjs-2.0.2/l
ib/execjs.rb:4:in `<top (required)>'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/uglifier-2.4.0
/lib/uglifier.rb:3:in `require'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/uglifier-2.4.0
/lib/uglifier.rb:3:in `<top (required)>'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/
lib/bundler/runtime.rb:72:in `require'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/
lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/
lib/bundler/runtime.rb:70:in `each'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/
lib/bundler/runtime.rb:70:in `block in require'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/
lib/bundler/runtime.rb:59:in `each'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/
lib/bundler/runtime.rb:59:in `require'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/
lib/bundler.rb:132:in `require'
from c:/Users/Marc Montagne/Desktop/pinteresting/config/application.rb:7
:in `<top (required)>'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.4
/lib/rails/commands/commands_tasks.rb:79:in `require'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.4
/lib/rails/commands/commands_tasks.rb:79:in `block in server'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.4
/lib/rails/commands/commands_tasks.rb:76:in `tap'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.4
/lib/rails/commands/commands_tasks.rb:76:in `server'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.4
/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/railties-4.1.4
/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
我理解的只是我有一个ExecJS问题。作为一个初学者,我甚至不知道ExecJS是什么。
All that I understand is that I have a problem with ExecJS. As a total beginner I don't even know what ExecJS is.
我读了很棒的帖子虽然编辑runtimes.rb并没有解决我的问题,但它仍然让我更好地了解情况和通过添加node.js来解决我的问题而不是忽略它的意愿,特别是考虑到我之前可以运行我的服务器并且我想修复我基本上已经破坏的事实。
I read the great thread #12520456 and while editing runtimes.rb didn't fix my problem, it still gave me a better understanding of the situation and the willingness to solve my problem by fixing it and not "ignoring it" by adding node.js especially given the fact that I could run my server before and that I want to fix what I basically broke.
我的意思是,我认为在编辑我的Windows环境的PATH(我甚至不知道这是什么)时我做错了什么来修复我安装Heroku的问题。我记得当我在某处读到它时编辑那部分,虽然它似乎修复了我的Heroku问题,但我觉得它搞砸了其余部分。
What I mean by that is that I think I did something wrong when editing the PATH (I don't even know what this is) of my Windows environment for fixing an issue I had with installing Heroku. I remember editing that part as I read it somewhere and while it seemed to have fixed my Heroku issue I think it messed up the rest.
提前感谢您的帮助和理解。
Thank you in advance for your help and understanding.
推荐答案
Ubuntu用户
我在Ubuntu上11.04并有类似的问题。安装Node.js修复它。
I'm on Ubuntu 11.04 and had similar issues. Installing Node.js fixed it.
从Ubuntu 13.04 x64起,你只需要运行:
As of Ubuntu 13.04 x64 you only need to run:
sudo apt-get install nodejs
这将解决问题。
CentOS / RedHat用户
This will solve the problem.CentOS/RedHat Users
sudo yum install nodejs
这篇关于Rails 4.1.4中的ExecJS :: RuntimeUnavailable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!