bundle installで「g++: コマンドが見つかりませんでした」の時

Ubuntu12, ruby 1.9.3p0, Rails 3.2.8で作業しています。

rails newで新しくアプリを作成する時、
rake db:createをした後、

rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.

のようなエラーが出た時はGemfile
[ruby]
gem ‘therubyracer’
[/ruby]
を追記すれば良いのですが、その後、bundle install

(省略)
Installing therubyracer (0.10.2) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb 
creating Makefile

make
compiling v8_template.cpp
make: g++: コマンドが見つかりませんでした
make: *** [v8_template.o] エラー 127


Gem files will remain installed in /home/takeshita/.bundler/tmp/2166/gems/therubyracer-0.10.2 for inspection.
Results logged to /home/takeshita/.bundler/tmp/2166/gems/therubyracer-0.10.2/ext/v8/gem_make.out
An error occurred while installing therubyracer (0.10.2), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.10.2'` succeeds before bundling.

のようなエラーが出てしまいました。
g++コマンドが無いようです。
そこで以下を実行しました。
[shell]
$ sudo aptitude install build-essential g++
[/shell]

インストール後、bundle installは正常終了しました。


出水市でWeb屋やってます。Webサイト作ったり、サーバ設定したりしている釣りの好きなMacユーザーです。 ドラクエ5のキラーパンサーにはゲレゲレと名付けました。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

コメントする

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください