在新的Rails安裝中出現以下錯誤。我運行了bundle install
,安裝了一堆寶石後,在嘗試安裝bcrypt-ruby時出現錯誤。我正在使用全新的Mac OS X 10.8.2,最新的Ruby(v1.9.3-p194),新的Rails(v3.2.8)和標準的Gemfile。無法爲新的Rails安裝安裝bcrypt-ruby
Installing activerecord (3.2.8)
Installing activeresource (3.2.8)
Installing bcrypt-ruby (3.0.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/me/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb creating Makefile
make compiling bcrypt_ext.c make: /usr/bin/gcc-4.2: No such file or directory make: * [bcrypt_ext.o] Error 1
Gem files will remain installed in /Users/me/.rvm/gems/[email protected]/gems/bcrypt-ruby-3.0.1 for inspection. Results logged to /Users/me/.rvm/gems/[email protected]/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out An error occurred while installing bcrypt-ruby (3.0.1), and Bundler cannot continue. Make sure that
gem install bcrypt-ruby -v '3.0.1'
succeeds before bundling.
UPDATE:忘了提,不僅在此品牌與Mac OS X 10.8.2的新Mac,而且全新安裝的Xcode昨天用命令行工具。然後我安裝了RVM和brew。
它看起來對我來說,你沒有讓你的系統上。如果您使用Mac,則需要安裝Xcode命令行工具。 –
已更新的問題表明已安裝Xcode命令行工具。 –
如果你要複製/粘貼別人的答案,至少可以提供信用http://stackoverflow.com/a/9084811/442695 – Bot