環境
OS: OS X Mavericks 10.9.5
Xcode: 6.0.1
ruby: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
Rails: 4.0.5
gem: 2.2.2
hitimes gemインストール時にエラー発生
RailsでGemfileに新しく追加したgemをインストールしようとした時にエラーが発生しました。
$ bundle install --without production $ bundle update
エラーログ
Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /Users/hoge/.rbenv/versions/2.1.1/bin/ruby extconf.rb creating Makefile make "DESTDIR=" clean Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo. make "DESTDIR=" Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo. make failed, exit code 69 Gem files will remain installed in /Users/hoge/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/hitimes-1.2.2 for inspection. Results logged to /Users/hoge/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/hitimes-1.2.2/gem_make.out An error occurred while installing hitimes (1.2.2), and Bundler cannot continue. Make sure that `gem install hitimes -v '1.2.2'` succeeds before bundling.
エラーの指示通りに、sudoコマンド付きでhitimes gemのインストールを実行してみますが、エラーが出てしまいます。
$ sudo gem install hitimes -v '1.2.2'
エラーログ
Building native extensions. This could take a while... ERROR: Error installing hitimes: ERROR: Failed to build gem native extension. /Users/hoge/.rbenv/versions/2.1.1/bin/ruby extconf.rb creating Makefile make "DESTDIR=" clean You have not agreed to the Xcode license agreements, please run 'xcodebuild -license' (for user-level acceptance) or 'sudo xcodebuild -license' (for system-wide acceptance) from within a Terminal window to review and agree to the Xcode license agreements. make "DESTDIR=" You have not agreed to the Xcode license agreements, please run 'xcodebuild -license' (for user-level acceptance) or 'sudo xcodebuild -license' (for system-wide acceptance) from within a Terminal window to review and agree to the Xcode license agreements. make failed, exit code 69 Gem files will remain installed in /Users/hoge/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/hitimes-1.2.2 for inspection. Results logged to /Users/hoge/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/hitimes-1.2.2/gem_make.out
解決方法
hitimes gemのインストールには、Xcodeの”License Agreement”が必要なようです。
そう言えば最近、Xcodeのアップデートをしたが、その後Xcodeを起動していなかった事に気づきました。
Xcodeを起動して、”License Agreement”をクリックしてXcodeのアップデートを実行します。
その後、再びインストールを試みました。
$ sudo gem install hitimes -v '1.2.2' Building native extensions. This could take a while... Successfully installed hitimes-1.2.2 Parsing documentation for hitimes-1.2.2 Installing ri documentation for hitimes-1.2.2 Done installing documentation for hitimes after 1 seconds 1 gem installed
無事にインストールに成功しました。
最後にRailsプロジェクトのgemのインストールを完了させます。
$ bundle update … Your bundle is updated! Gems in the group production were not installed. … $ bundle install … Your bundle is complete! Gems in the group production were not installed. Use `bundle show [gemname]` to see where a bundled gem is installed.
コメント