首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装bcrypt-ruby时出错(3.0.1)

安装bcrypt-ruby时出错(3.0.1)
EN

Stack Overflow用户
提问于 2015-07-23 03:22:48
回答 2查看 304关注 0票数 1

我在mac上安装crypt-ruby 3.0.1时遇到了问题。现在有没有人知道这是什么原因?下面是下面的输出错误。

代码语言:javascript
复制
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
EN

回答 2

Stack Overflow用户

发布于 2021-09-09 09:08:16

According to this article,它似乎是由mac上的xcode工具更新引起的,要修复这个问题,你需要添加一个标志来忽略这个错误,就像以前一样。

例如,在我的例子中,这是可行的:

代码语言:javascript
复制
gem install bcrypt-ruby:3.0.1 -- --build-flags --with-cflags="-Wno-error=implicit-function-declaration"
票数 1
EN

Stack Overflow用户

发布于 2018-04-25 05:14:38

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

代码语言:javascript
复制
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命令行工具:

代码语言:javascript
复制
xcode-select --install

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31572226

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档