1

最初、

gem 'libv8', '~> 3.11.8'===libv8 (~> 3.11.8.12)
gem 'execjs'==========execjs (>= 0.3.0)
gem 'therubyracer'====therubyracer (0.11.4)

Gemfile に存在する

Gemfile.lock show (libv8 (~> 3.11.8.12),execjs (>= 0.3.0),therubyracer (0.11.4))

centos5.7にはすでにnodejs Myprojectがありますが、rakeを使用しても問題ありませんが、crontabはエラーです。

私の実行.shタイプのファイル

#!/bin/bash
export PATH=$PATH:/usr/local/bin
cd /abc && bundle exec rake RAILS_ENV=production sync:abc

エラー

Warning: NLS_LANG is not set. fallback to US7ASCII.
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
/opt/app/ruby/lib/ruby/gems/1.9.1/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in autodetect'
/opt/app/ruby/lib/ruby/gems/1.9.1/gems/execjs-1.4.0/lib/execjs.rb:5:inmodule:ExecJS'
/opt/app/ruby/lib/ruby/gems/1.9.1/gems/execjs-1.4.0/lib/execjs.rbin '
/opt/app/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.12/lib/active_support/dependencies.rb:240:inrequire'
/opt/app/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.12/lib/active_support/dependencies.rb:240:in block in require'
/opt/app/ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.1.12/lib/active_support/dependencies.rb:223:inblock in load_dependency'
4

2 に答える 2

0

上記のgemには依存関係があるため、nodejsをインストールする必要があります。ここでインストールリポジトリリンクのリストを取得します https://github.com/sstephenson/execjs

しかし、あなたが述べたように、nodjsはすでにインストールされています。システムにgemをインストールする際に、ライブラリとインクルードパスを指定できます。

あなたがunbuntuユーザーであれば、コマンドでインストールできます

apt-get インストール nodejs

于 2013-07-15T09:08:01.487 に答える