goo blog サービス終了のお知らせ 

あれやこれやの日々

幅広いエンジニアリング情報を掲載

rails起動でJavaScriptエラー:(Bundler::GemRequireError) Gem Load Error is: Could not find a JavaScript .

2018年05月05日 | ブログ
Fedoracore20にruby-2.2.0とrails-4.1.1のインストールに成功したので、railsサーバーを
起動してみたが、またまた何やらエラーが・・・

Error message:
Array values in the parameter to `Gem.paths=` are deprecated.
Please use a String or nil.
An Array ({"GEM_PATH"=>["/usr/local/lib/ruby/gems/2.2.0", "/root/.gem/ruby/2.2.0"]}) was passed in from bin/rails:3:in `load'
/usr/local/lib/ruby/site_ruby/2.2.0/bundler/runtime.rb:84:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
Backtrace for gem load error is:


これはNode.jsがインストールされていないことが原因らしい。
Node.jsのインストール手順は以下の通り。

1)公式サイトからNode.jsをダウンロード

URL:https://nodejs.org/ja/からソースファイルをダウンロードする。
File name:node-v8.11.1.tar.gz


2)解凍、ビルド、インストール
>tar xvzf node-v8.11.1.tar.gz -C /usr/local/src
>cd /usr/local/src/node-v8.11.1
>./configure
>make
>sudo make instal
>cd /home/username/Documents/Aptana/Projectname << railsのプロジェクトフォルダへ移動
>rails s


これでやっとrailsサーバーの起動に成功!
毎度、同じことをやっているのに、新しいエラーに沢山遭遇するのは困りものだ・・・
やれやれだぜ!


最新の画像もっと見る

コメントを投稿