问题描述
我试图安装Devises gem,运行 bundle install
,然后使用我以前没有的bcrypt-ruby得到这个错误。我可以做什么?
使用本机扩展安装bcrypt-ruby(3.0.1)
Gem :: Installer: :ExtensionBuildError:错误:无法构建gem本机扩展。
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
创建Makefile
make
xcrun cc -I。 -I / System / Library / Frameworks / Ruby.framework / Versions / 1.8 / usr / lib / ruby / 1.8 / universal-darwin11.0 -I / System / Library / Frameworks / Ruby.framework / Versions / 1.8 / usr / lib /ruby/1.8/universal-darwin11.0 -I。 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c bcrypt_ext.c
错误:没有开发者目录在/ Developer上找到。运行/ usr / bin / xcode-select更新开发者目录路径。
make:*** [bcrypt_ext.o]错误1
Gem文件将保留安装在/Users/Fryed/.bundler/tmp/25124/gems/bcrypt- ruby-3.0.1进行检查。
结果记录到/Users/Fryed/.bundler/tmp/25124/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out
安装bcrypt-ruby时发生错误(3.0 .1)和Bundler无法继续。
确保在捆绑之前,gem install bcrypt-ruby -v'3.0.1'`成功。
好的,所以我需要安装bcrypt-ruby ...
wpub-6-65:treebook Fryed $ sudo gem install bcrypt-ruby -v'3.0.1'
密码:
建立native扩展。这可能需要一段时间...
错误:安装bcrypt-ruby错误:
错误:无法构建gem本机扩展。
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
创建Makefile
make
xcrun cc -I。 -I / System / Library / Frameworks / Ruby.framework / Versions / 1.8 / usr / lib / ruby / 1.8 / universal-darwin11.0 -I / System / Library / Frameworks / Ruby.framework / Versions / 1.8 / usr / lib /ruby/1.8/universal-darwin11.0 -I。 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c bcrypt_ext.c
错误:没有开发者目录在/ Developer上找到。运行/ usr / bin / xcode-select更新开发者目录路径。
make:*** [bcrypt_ext.o]错误1
Gem文件将保留安装在/Library/Ruby/Gems/1.8/gems/bcrypt-ruby-3.0 .1进行检查。
记录到/Library/Ruby/Gems/1.8/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out
解决方案gem'bcrypt-ruby','〜> 3.0.1',::github = > 'rking / bcrypt-ruby'
rking的bcrypt-ruby分支注释掉3.0版的c编译补丁0.1。 Bcrypt-ruby在一年前解决了这个问题,但不适用于版本3.0.1,这似乎是您的Rails应用程序需要的依赖项。
查看github上的问题:
I'm trying to install the Devises gem, running
bundle install
and then getting this error with bcrypt-ruby which I haven't had before. What can I do?Installing bcrypt-ruby (3.0.1) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb creating Makefile make xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c bcrypt_ext.c Error: No developer directory found at /Developer. Run /usr/bin/xcode-select to update the developer directory path. make: *** [bcrypt_ext.o] Error 1 Gem files will remain installed in /Users/Fryed/.bundler/tmp/25124/gems/bcrypt-ruby-3.0.1 for inspection. Results logged to /Users/Fryed/.bundler/tmp/25124/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out An error occured 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.
Okay, so I need to install bcrypt-ruby...
wpub-6-65:treebook Fryed$ sudo gem install bcrypt-ruby -v '3.0.1' Password: Building native extensions. This could take a while... ERROR: Error installing bcrypt-ruby: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb creating Makefile make xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -c bcrypt_ext.c Error: No developer directory found at /Developer. Run /usr/bin/xcode-select to update the developer directory path. make: *** [bcrypt_ext.o] Error 1 Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/bcrypt-ruby-3.0.1 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out
解决方案gem 'bcrypt-ruby', '~>3.0.1', :github => 'rking/bcrypt-ruby'
rking's fork of bcrypt-ruby comments out failing c compilation patch for 3.0.1. Bcrypt-ruby fixed this problem a year ago, but not for version 3.0.1, which seems to be the dependency your Rails app requires.
See the issue on github:https://github.com/bundler/bundler/issues/2410
这篇关于安装bcyrpt-ruby gem bundle时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!