简体   繁体   English

Ruby gem 'byebug 5.0.0' 由于出错而安装失败

[英]Ruby gem 'byebug 5.0.0' failing on install due to make error

I'm attempting to install the byebug gem v5.0.0 in a ubuntu environment.我正在尝试在 ubuntu 环境中安装 byebug gem v5.0.0。 The v 5.0.0 is a project requirement, I can not use a newer version . v 5.0.0 是项目要求,我不能使用较新的版本 These are the current versions that I am using这些是我正在使用的当前版本

bundle -v
Bundler version 2.1.4

ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]

bundle -v
Bundler version 2.1.4

rvm -v
rvm 1.29.10 (manual) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

rails -v
Rails 5.2.3

When I attempt to install with gem install byebug -v 5.0.0 the following is written to cli.当我尝试使用gem install byebug -v 5.0.0进行安装时,以下内容将写入 cli。 The install appears to be failing when executing the make file for the gem执行 gem 的 make 文件时安装似乎失败

Even if i attempt to execute make in the /var/lib/gems/2.7.0/gems/byebug-5.0.0/ext/byebug directory, I get the same error message starting with the context.c file.即使我尝试在/var/lib/gems/2.7.0/gems/byebug-5.0.0/ext/byebug目录中执行make ,我也会收到从 context.c 文件开始的相同错误消息。

This seems to be some install issue with the 5.0.0 version, I did attempt to install the newest version of byebug for testing, and it installed successfully.这似乎是 5.0.0 版本的一些安装问题,我确实尝试安装最新版本的 byebug 进行测试,并且安装成功。

current directory: /var/lib/gems/2.7.0/gems/byebug-5.0.0/ext/byebug
/usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20201011-7796-1qpm603.rb extconf.rb
creating Makefile

current directory: /var/lib/gems/2.7.0/gems/byebug-5.0.0/ext/byebug
make "DESTDIR=" clean

current directory: /var/lib/gems/2.7.0/gems/byebug-5.0.0/ext/byebug
make "DESTDIR="
compiling breakpoint.c
compiling byebug.c
compiling context.c
context.c: In function ‘call_with_debug_inspector’:
context.c:191:20: error: passing argument 1 of ‘rb_ensure’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  191 |   return rb_ensure(open_debug_inspector, (VALUE) data, close_debug_inspector,
      |                    ^~~~~~~~~~~~~~~~~~~~
      |                    |
      |                    VALUE (*)(struct call_with_inspection_data *) {aka long unsigned int (*)(struct call_with_inspection_data *)}
In file included from /usr/include/ruby-2.7.0/ruby.h:33,
                 from ./byebug.h:4,
                 from context.c:1:
/usr/include/ruby-2.7.0/ruby/ruby.h:1990:17: note: expected ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’} but argument is of type ‘VALUE (*)(struct call_with_inspection_data *)’ {aka ‘long unsigned int (*)(struct call_with_inspection_data *)’}
 1990 | VALUE rb_ensure(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE),VALUE);
      |                 ^~~~~~~~~~~~~~~
context.c:191:56: error: passing argument 3 of ‘rb_ensure’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  191 |   return rb_ensure(open_debug_inspector, (VALUE) data, close_debug_inspector,
      |                                                        ^~~~~~~~~~~~~~~~~~~~~
      |                                                        |
      |                                                        VALUE (*)(struct call_with_inspection_data *) {aka long unsigned int (*)(struct call_with_inspection_data *)}
In file included from /usr/include/ruby-2.7.0/ruby.h:33,
                 from ./byebug.h:4,
                 from context.c:1:
/usr/include/ruby-2.7.0/ruby/ruby.h:1990:39: note: expected ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’} but argument is of type ‘VALUE (*)(struct call_with_inspection_data *)’ {aka ‘long unsigned int (*)(struct call_with_inspection_data *)’}
 1990 | VALUE rb_ensure(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE),VALUE);
      |                                       ^~~~~~~~~~~~~~~
In file included from /usr/include/ruby-2.7.0/ruby/ruby.h:2148,
                 from /usr/include/ruby-2.7.0/ruby.h:33,
                 from ./byebug.h:4,
                 from context.c:1:
context.c: In function ‘Init_context’:
/usr/include/ruby-2.7.0/ruby/intern.h:1218:137: error: passing argument 3 of ‘rb_define_singleton_method1’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 1218 | #define rb_define_singleton_method(klass, mid, func, arity) rb_define_singleton_method_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
      |                                                                                                                                         ^~~~~~
      |                                                                                                                                         |
      |                                                                                                                                         VALUE (*)(VALUE) {aka long unsigned int (*)(long unsigned int)}
context.c:673:3: note: in expansion of macro ‘rb_define_singleton_method’
  673 |   rb_define_singleton_method(cDebugThread, "inherited", dt_inherited, 1);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1195:27: note: expected ‘VALUE (*)(VALUE,  VALUE)’ {aka ‘long unsigned int (*)(long unsigned int,  long unsigned int)’} but argument is of type ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’}
 1195 | RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name))
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1042:82: note: in definition of macro ‘RB_METHOD_DEFINITION_DECL_C’
 1042 |     __attribute__((__unused__,__weakref__(#def),__nonnull__ nonnull))static void defname(RB_UNWRAP_MACRO decl,VALUE(*func)funcargs,int arity);
      |                                                                                  ^~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1075:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL_1’
 1075 | RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##1 ,1 ,decl,vars,(VALUE,VALUE)) \
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1195:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL’
 1195 | RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name))
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:245: context.o] Error 1

make failed, exit code 2

That version of byebug is from 2015 when ruby was on v2.2.1 byebug 的那个版本来自 2015 年,当时 ruby​​ 在 v2.2.1

If you can't use a newer bye bug;如果你不能使用较新的再见错误; use the older ruby.使用较旧的红宝石。

That older version of ruby is probably going to require you to use older versions of all the gems your project needs.旧版本的 ruby​​ 可能会要求您使用项目所需的所有 gem 的旧版本。 Do you have a Gemfile.lock showing the target versions?你有显示目标版本的 Gemfile.lock 吗? If not you might have to use ruby gems to find what version each gen was the latest in early 2015.如果不是,您可能必须使用 ruby​​ gems 来查找每个 gen 在 2015 年初的最新版本。

https://rubygems.org/gems/byebug/versions Shows the version released dates for byebug. https://rubygems.org/gems/byebug/versions显示 byebug 的版本发布日期。

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

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