为什么在运行bundle install时,所有具有本机扩展的gem都无法安装?

时间:2016-07-24 15:37:43

标签: ruby-on-rails ruby

我使用ruby 2.2.5并且bundle install无法安装具有原生扩展名的gem。 这是我为json gem获得的错误。

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

    /Users/Mr_AdeyBee/.rvm/rubies/ruby-2.2.5/bin/ruby -r ./siteconf20160724-3304-1j34bow.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling bcrypt_ext.c
compiling crypt.c
compiling crypt_blowfish.c
compiling crypt_gensalt.c
compiling wrapper.c
linking shared-object bcrypt_ext.bundle
ld: warning: directory not found for option '-L/Users/travis/.sm/pkg/active/lib'

make "DESTDIR=" install
make: /usr/local/bin/gmkdir: No such file or directory
make: *** [.RUBYARCHDIR.time] Error 1

make install failed, exit code 2

Gem files will remain installed in /Users/Mr_AdeyBee/.rvm/gems/ruby-2.2.5/gems/bcrypt-3.1.11 for inspection.
Results logged to /Users/Mr_AdeyBee/.rvm/gems/ruby-2.2.5/extensions/x86_64-darwin-15/2.2.0-static/bcrypt-3.1.11/gem_make.out

这也是byebug的错误。

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

    /Users/Mr_AdeyBee/.rvm/rubies/ruby-2.2.5/bin/ruby -r ./siteconf20160724-3304-1vjgvan.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling breakpoint.c
compiling byebug.c
compiling context.c
compiling locker.c
compiling threads.c
linking shared-object byebug/byebug.bundle
ld: warning: directory not found for option '-L/Users/travis/.sm/pkg/active/lib'

make "DESTDIR=" install
make: /usr/local/bin/gmkdir: No such file or directory
make: *** [.RUBYARCHDIR.-.byebug.time] Error 1

make install failed, exit code 2

Gem files will remain installed in /Users/Mr_AdeyBee/.rvm/gems/ruby-2.2.5/gems/byebug-9.0.5 for inspection.
Results logged to /Users/Mr_AdeyBee/.rvm/gems/ruby-2.2.5/extensions/x86_64-darwin-15/2.2.0-static/byebug-9.0.5/gem_make.out

我尝试使用sudo进行安装,但得到了相同的结果。我也尝试了一些谷歌建议的结果,我似乎找不到合适的解决方案。

Ruby版本 - > 2.2.5 Rails版本 - > 4.2.5

我怎么能克服这个?

1 个答案:

答案 0 :(得分:2)

尝试:

    > brew install coreutils
    > gem install json