繁体   English   中英

无法安装bcrypt-ruby(3.0.1)

[英]Trouble Installing bcrypt-ruby (3.0.1)

我在Mac上安装crypt-ruby 3.0.1时遇到问题。 现在有人会导致这种情况吗? 以下是以下输出错误。

Dorians-MacBook-Pro:rentsnap_webapp dorianflowers$ gem install bcrypt-ruby -v '3.0.1'
Building native extensions.  This could take a while...
ERROR:  Error installing bcrypt-ruby:
  ERROR: Failed to build gem native extension.

      /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/bin/ruby -r ./siteconf20150722-8311-1gpgksu.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling bcrypt_ext.c
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:29,
             from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
             from bcrypt_ext.c:1:
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:26:19: error: stdio.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:28:24: error: sys/types.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:31:23: error: sys/stat.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:34:21: error: stdlib.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:45:21: error: string.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:48:22: error: strings.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:51:23: error: inttypes.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:54:21: error: stdint.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:57:21: error: unistd.h: No such file or directory
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:61:25: error: sys/select.h: No such file or directory
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/defines.h:68,
                 from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:29,
                 from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
                 from bcrypt_ext.c:1:
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/missing.h:23:45: error: math.h: No such file or directory
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:184,
                 from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
                 from bcrypt_ext.c:1:
/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:15:25: error: limits.h: No such file or directory
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:35,
                 from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:1694,
                 from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
                 from bcrypt_ext.c:1:
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/st.h:139: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
In file included from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/ruby.h:1694,
                 from /Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby.h:33,
                 from bcrypt_ext.c:1:
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:348: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fdset_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: error: expected declaration specifiers or ‘...’ before ‘fd_set’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: warning: ‘struct timeval’ declared inside parameter list
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:440: warning: its scope is only this definition or declaration, which is probably not what you want
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:441: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:441: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:441: error: expected declaration specifiers or ‘...’ before ‘rb_fdset_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:441: warning: ‘struct timeval’ declared inside parameter list
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:442: warning: ‘struct timeval’ declared inside parameter list
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:545: error: expected declaration specifiers or ‘...’ before ‘mode_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:624: error: expected declaration specifiers or ‘...’ before ‘pid_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:638: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fork’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:639: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_fork_err’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:641: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_waitpid’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:642: error: expected ‘)’ before ‘pid’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:643: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:644: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rb_spawn_err’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:646: error: expected ‘)’ before ‘pid’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:755: error: expected declaration specifiers or ‘...’ before ‘uint32_t’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:882: error: expected ‘)’ before ‘long’
/Users/dorianflowers/.rvm/rubies/ruby-2.1.0/include/ruby-2.1.0/ruby/intern.h:883: error: expected ‘)’ before ‘long’
bcrypt_ext.c: In function ‘bc_salt’:
bcrypt_ext.c:46: warning: incompatible implicit declaration of built-in function ‘strlen’
make: *** [bcrypt_ext.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/dorianflowers/.rvm/gems/ruby-2.1.0/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /Users/dorianflowers/.rvm/gems/ruby-2.1.0/extensions/x86_64-darwin-14/2.1.0-static/bcrypt-ruby-3.0.1/gem_make.out

这些错误都表明您的计算机上没有编译器:

error: stdio.h: No such file or directory
error: sys/types.h: No such file or directory
error: sys/stat.h: No such file or directory
error: stdlib.h: No such file or directory
error: string.h: No such file or directory
error: strings.h: No such file or directory
error: inttypes.h: No such file or directory
error: stdint.h: No such file or directory
error: unistd.h: No such file or directory
error: sys/select.h: No such file or directory

在macOS上,解决此问题的最简单方法是安装Xcode命令行工具:

xcode-select --install

Xcode命令行工具包括上述所有库和构建bcrypt-ruby所需的编译器。 (以及大多数其他宝石)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM