LoginSignup
0
0

More than 1 year has passed since last update.

bundle installで初期化できない

Last updated at Posted at 2021-07-25

要約

  • Macbookから一度削除したプロジェクトをもう一度クローンした
  • Macbookは、削除からクローンの間に、クリーンインストールしてTimeMachineBackupから復元している。
  • xcodeがインストールされていないことに起因するエラーであった。

プロジェクトクローン時に引っかかった

% bundle installをするもエラーが大量発生

An error occurred while installing nio4r (2.5.7), and Bundler cannot continue.
Make sure that `gem install nio4r -v '2.5.7' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  rails was resolved to 6.1.3.2, which depends on
    actioncable was resolved to 6.1.3.2, which depends on
      nio4r


Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/n-syuichi/IdeaProjects/ReservationSample/vendor/bundle/ruby/2.7.0/gems/bcrypt-3.1.16/ext/mri
/Users/n-syuichi/.rbenv/versions/2.7.2/bin/ruby -I /Users/n-syuichi/.rbenv/versions/2.7.2/lib/ruby/2.7.0 -r ./siteconf20210725-26400-18rx3v2.rb extconf.rb
creating Makefile

current directory: /Users/n-syuichi/IdeaProjects/ReservationSample/vendor/bundle/ruby/2.7.0/gems/bcrypt-3.1.16/ext/mri
make "DESTDIR=" clean
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

current directory: /Users/n-syuichi/IdeaProjects/ReservationSample/vendor/bundle/ruby/2.7.0/gems/bcrypt-3.1.16/ext/mri
make "DESTDIR="
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

make failed, exit code 1

Gem files will remain installed in /Users/n-syuichi/IdeaProjects/ReservationSample/vendor/bundle/ruby/2.7.0/gems/bcrypt-3.1.16 for inspection.
Results logged to /Users/n-syuichi/IdeaProjects/ReservationSample/vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-20/2.7.0/bcrypt-3.1.16/gem_make.out

An error occurred while installing bcrypt (3.1.16), and Bundler cannot continue.
Make sure that `gem install bcrypt -v '3.1.16' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  devise-i18n was resolved to 1.10.0, which depends on
    devise was resolved to 4.8.0, which depends on
      bcrypt


解決策(結論)

% xcode-select --install を実行し、Xcode Commandlinetoolをインストール

原因

MacBookのSSD換装を行い、OS新規インストール後TimeMachineから復元したため、Xcode等がインストールされていなかった。

チェックしたこと

  • bundlerのパス(vendor/bundleにインストールされているか)
  • rubyのバージョン(rbenv等)
  • エラーメッセージのコマンド実行(Gemコマンドからのインストール)ができるかどうか
  • bundlerがインストールされているかどうか

参照先

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0