0

我正在尝试运行我的虚拟 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了,但无论如何我仍然会遇到同样的错误。

编辑:还尝试了我在谷歌上找到的其他东西,将 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 命令,但它仍然没有工作。任何人?

4

1 回答 1

0

添加该行gem 'therubyracer',然后bundle install.

于 2014-11-28T12:01:58.127 回答