简体   繁体   English

即使已安装,Rails也找不到NodeJS

[英]Rails Can't Find NodeJS Even Though it is Installed

When I run "rake assets:clean" I get the error: 当我运行“ rake asset:clean”时,出现错误:

ExecJS::RuntimeUnavailable: Node.js (V8) runtime is not available on this system

There are several posts about this, but they all say "install nodejs" 关于此有好几篇文章,但都说“ install nodejs”

I have installed nodejs though. 我已经安装了nodejs。

$ which nodejs
/usr/bin/nodejs
$ nodejs -v
v0.10.25

And also nodejs legacy 还有Node.js旧版

$ which node
/usr/bin/node
$ node -v
v0.10.25

I'm on Ubuntu 14. 我在Ubuntu 14。

$ rake about
...
Ruby version              1.9.3 (x86_64-linux)
RubyGems version          2.4.3
Rack version              1.4
Rails version             3.2.13
JavaScript Runtime        Node.js (V8)
Active Record version     3.2.13
....

What is really killing me is that this was working fine until I tried to remove a binstubs warning by cleaning the bin directory. 真正使我丧命的是,它一直运行良好,直到我尝试通过清理bin目录来删除binstubs警告。

I've tried to undo everything I did to fix the binstubs issue - going back to a clean version in git, reinstalling rvm, reinstalling ruby, reinstalling my gems. 我试图撤消为解决binstubs问题所做的一切-回到git中的干净版本,重新安装rvm,重新安装ruby,重新安装我的gem。 I'm out of ideas on how to fix this. 我没有解决此问题的想法。

I wonder if it's something stupid like an issue with my PATH: 我想知道这是否有点愚蠢,例如我的PATH问题:

$ echo $PATH
/home/andy/.rvm/gems/ruby-1.9.3-p551/bin:/home/andy/.rvm/gems/ruby-1.9.3-p551@global/bin:/home/andy/.rvm/rubies/ruby-1.9.3-p551/bin:/home/andy/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/heroku/bin

I had added "PATH: './bin:$PATH'" to my local_env.yml file. 我已经在我的local_env.yml文件中添加了“ PATH:'./ bin:$ PATH'”。 See comment above. 请参阅上面的评论。 Doh! h!

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM