【问题标题】:An error occurred while installing thin (1.7.2)安装瘦 (1.7.2) 时出错
【发布时间】:2020-09-11 17:03:06
【问题描述】:

我尝试安装瘦 Web 服务器,版本 1.7.2 但出现错误

使用日志:

thin.c:359:10: error: implicit declaration of function 'thin_http_parser_has_error' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
  return thin_http_parser_has_error(http) ? Qtrue : Qfalse;
         ^
thin.c:374:10: error: implicit declaration of function 'thin_http_parser_is_finished' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
  return thin_http_parser_is_finished(http) ? Qtrue : Qfalse;
         ^
9 errors generated.
make: *** [thin.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/Users/dorianmarie/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/thin-1.7.2 for inspection.
Results logged to
/Users/dorianmarie/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-19/2.7.0/thin-1.7.2/gem_make.out

An error occurred while installing thin (1.7.2), and Bundler cannot continue.
Make sure that `gem install thin -v '1.7.2' --source 'https://rubygems.org/'` succeeds before bundling.

【问题讨论】:

    标签: ruby bundler thin


    【解决方案1】:

    禁用错误修复它:

    bundle config build.thin --with-cflags="-Wno-error=implicit-function-declaration"
    

    【讨论】:

    • 我也遇到了同样的错误,并且您的配置行有效,所以谢谢!但是我想知道禁用错误是否是最好的解决方案,因为错误可能是由于合法问题而发生的。有什么想法吗?
    • 这是一个临时修复。有关说明,请参阅stackoverflow.com/questions/63278694/…。看来这个问题已经在 Thin 的 master 分支中修复了,请参阅 github.com/macournoyer/thin/issues/370
    【解决方案2】:

    对我有用的解决方案略有不同。我必须在 Big Sur 11.3.1 上使用 rbenv 为我的特定 gem 版本运行以下命令。我添加了对我的特定错误和解决方案here的更深入的解释。

    gem install thin -v '1.6.4' -- --with-cflags="-Wno-error=implicit-function-declaration"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-22
      • 1970-01-01
      • 1970-01-01
      • 2020-09-12
      • 2013-10-05
      • 2013-08-15
      相关资源
      最近更新 更多