耙db:创建 - rake aborted!找不到JavaScript运行时。 'Therubyracer'& 'execjs'没有解决问题

时间:2013-07-09 04:55:57

标签: javascript ruby-on-rails rake

我正在尝试运行我的虚拟linux盒并在本地托管我的项目,但当我rake db:create时,我不断收到此错误:

rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a       list of available runtimes.
/home/vagrant/.rvm/gems/ruby-2.0.0-p247/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `      autodetect'
/home/vagrant/.rvm/gems/ruby-2.0.0-p247/gems/execjs-1.4.0/lib/execjs.rb:5:in          `<module:ExecJS>'
/home/vagrant/.rvm/gems/ruby-2.0.0-p247/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top     (required)>'
/home/vagrant/.rvm/gems/ruby-2.0.0-p247/gems/uglifier-2.1.1/lib/uglifier.rb:3:in   `require'
/home/vagrant/.rvm/gems/ruby-2.0.0-p247/gems/uglifier-2.1.1/lib/uglifier.rb:3:in `<top   (required)>'
/home/vagrant/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/home/vagrant/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler    -1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/home/vagrant/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-     1.3.5/lib/bundler/runtime.rb:70:in `each'
/home/vagrant/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-    1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/home/vagrant/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-    1.3.5/lib/bundler/runtime.rb:59:in `each'
/home/vagrant/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/home/vagrant/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:132:in   `require'
/home/vagrant/start.it/config/application.rb:7:in `<top (required)>'
/home/vagrant/start.it/Rakefile:4:in `require'
/home/vagrant/start.it/Rakefile:4:in `<top (required)>'
/home/vagrant/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
/home/vagrant/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)

我已尝试将gem 'therubyracer'gem 'execjs'添加到我的gemfile中,并且我已尝试将两者分别安装到目录中。我还下载了node.js,但无论如何我仍然会得到同样的错误。

编辑:还尝试了我在Google上找到的其他内容,将gemfile编辑为gem 'therubyracer', :platforms => :ruby - 同样的错误。

编辑2:也尝试过:

$ git clone git://github.com/ry/node.git
$ cd node
$ ./configure
$ make
$ sudo make install

并在运行make时出现以下错误:

make -C out BUILDTYPE=Release V=1
g++ '-D_DARWIN_USE_64_BIT_INODE=1' '-DNODE_WANT_INTERNALS=1' '-DARCH="x64"' '-          DNODE_TAG=""' '-DHAVE_OPENSSL=1' '-DHAVE_DTRACE=1' '-D__POSIX__' '-DPLATFORM="darwin"' '-      D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' -I../src -I../tools/msvs/genfiles -  I../deps/uv/src/ares -I/Users/annikamonari/Hi/node/out/Release/obj/gen -    I../deps/openssl/openssl/include -I../deps/v8/include -I../deps/zlib -I../deps/http_parser -    I../deps/cares/include -I../deps/uv/include  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch    x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-rtti -fno-exceptions -fno-     threadsafe-statics -fno-strict-aliasing -MMD -MF        /Users/annikamonari/Hi/node/out/Release/.deps//Users/annikamonari/Hi/node/out/Release/obj.ta    rget/node/src/cares_wrap.o.d.raw  -c -o     /Users/annikamonari/Hi/node/out/Release/obj.target/node/src/cares_wrap.o    ../src/cares_wrap.cc
 ../deps/v8/include/v8.h: In function ‘void      node::cares_wrap::AfterGetAddrInfo(uv_getaddrinfo_t*, int, addrinfo*)’:
 ../deps/v8/include/v8.h:6394: error: ‘always_inline’ function could not be inlined in      call to ‘v8::Handle<v8::Primitive> v8::Null(v8::Isolate*)’: function not inlinable
 ../src/cares_wrap.cc:800: error: called from here
 make[1]: *** [/Users/annikamonari/Hi/node/out/Release/obj.target/node/src/cares_wrap.o]      Error 1
 make: *** [node] Error 2

打了这个错误,继续然后尝试了rake命令,但它仍然无法正常工作。任何人吗?

1 个答案:

答案 0 :(得分:0)

添加第gem 'therubyracer'行,然后添加bundle install