【问题标题】:Can't install kgio 2.8.1 on Ubuntu 14.04无法在 Ubuntu 14.04 上安装 kgio 2.8.1
【发布时间】:2016-03-24 12:48:54
【问题描述】:

注意:我运行的是 Ubuntu,而不是 Windows。

这是尝试安装 kgio 时发生的情况。我是否缺少依赖项,我要安装什么?

gilani@debris$ gem install kgio -v '2.8.1' 
Building native extensions.  This could take a while...
ERROR:  Error installing kgio:
    ERROR: Failed to build gem native extension.

    /home/gilani/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20151218-13133-1dvzrlz.rb extconf.rb
checking for CLOCK_MONOTONIC in time.h... yes
checking for clockid_t in time.h... yes
checking for clock_gettime() in -lrt... yes
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for poll() in poll.h... yes
checking for getaddrinfo() in sys/types.h,sys/socket.h,netdb.h... yes
checking for getnameinfo() in sys/types.h,sys/socket.h,netdb.h... yes
checking for struct sockaddr_storage in sys/types.h,sys/socket.h... yes
checking for accept4() in sys/socket.h... yes
checking for sys/select.h... yes
checking for writev() in sys/uio.h... yes
checking for ruby/io.h... yes
checking for rb_io_t.fd in ruby.h,ruby/io.h... yes
checking for rb_io_t.mode in ruby.h,ruby/io.h... yes
checking for rb_io_t.pathv in ruby.h,ruby/io.h... yes
checking for struct RFile in ruby.h,ruby/io.h... yes
checking size of struct RFile in ruby.h,ruby/io.h... 24
checking for struct RObject... yes
checking size of struct RObject... 40
checking size of int... 4
checking for rb_io_ascii8bit_binmode()... yes
checking for rb_update_max_fd()... yes
checking for rb_fd_fix_cloexec()... yes
checking for rb_cloexec_open()... yes
checking for rb_thread_blocking_region()... no
checking for rb_thread_io_blocking_region()... yes
checking for rb_str_set_len()... yes
checking for rb_time_interval()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_str_subseq()... yes
checking for rb_ary_subseq()... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling wait.c
compiling autopush.c
compiling tryopen.c
tryopen.c:42:0: warning: "RUBY_UBF_IO" redefined [enabled by default]
 #  define RUBY_UBF_IO ((void *)(-1))
 ^
In file included from /home/gilani/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/ruby.h:1710:0,
                 from /home/gilani/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby.h:33,
                 from tryopen.c:1:
/home/gilani/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:902:0: note: this is the location of the previous definition
 #define RUBY_UBF_IO ((rb_unblock_function_t *)-1)
 ^
In file included from tryopen.c:43:0:
/home/gilani/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/backward/rubysig.h:14:2: warning: #warning rubysig.h is obsolete [-Wcpp]
 #warning rubysig.h is obsolete
  ^
tryopen.c: In function ‘my_thread_blocking_region’:
tryopen.c:52:2: error: ‘TRAP_BEG’ undeclared (first use in this function)
  TRAP_BEG; /* for FIFO */
  ^
tryopen.c:52:2: note: each undeclared identifier is reported only once for each function it appears in
tryopen.c:54:2: error: ‘TRAP_END’ undeclared (first use in this function)
  TRAP_END;
  ^
make: *** [tryopen.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/gilani/.rvm/gems/ruby-2.2.1/gems/kgio-2.8.1 for inspection.
Results logged to /home/gilani/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/kgio-2.8.1/gem_make.out

【问题讨论】:

  • “/home/gilani/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/kgio-2.8.1/gem_make.out”是否告诉您其他任何信息?
  • @theTinMan 根本没有,它包含上面的确切错误文本,当然最后两个语句除外。
  • 您正在尝试针对比其编写的版本更新的 ruby​​ 版本编译 gem,kgio 2.8.1 于 2013 年发布(bogomips.org/kgio.git/tag/?h=v2.8.1),ruby 2.2.1 于 2015 年 3 月发布(ruby-lang.org/en/news/2015/03/03/ruby-2-2-1-released)
  • @bjhaid 修复了它!谢谢!您可以将其发布为答案,我会将其标记为已回答:)

标签: ruby-on-rails ruby ubuntu bundler


【解决方案1】:

发现如果你的rvm没有加载,你可能会收到同样的错误。 验证是否加载了 rvm 尝试:

rvm use 2.x.x

如果您收到以下警告:

您需要更改终端模拟器首选项以允许登录 贝壳。有时需要使用/bin/bash --login 作为 命令。请访问https://rvm.io/integration/gnome-terminal/ 一个例子。

这可能也是你的情况:-)

/bin/bash --login
rvm use 2.x.x

在撞了大约一个小时后为我解决了为什么会发生这种情况

【讨论】:

    【解决方案2】:

    这些组合在 Ubuntu 16.04 上帮助了我:

    apt-get install ruby-kgio

    bundle update kgio

    【讨论】:

    • 不幸的是,这对我没有帮助。
    【解决方案3】:

    正如@bjhaid 在 cmets 中回答的那样,并没有跟进。我会自己在这里发布以关闭问题:

    您正在尝试针对比 ruby​​ 更新的 ruby​​ 版本编译 gem 它所针对的是,kgio 2.8.1 发布于 2013(bogomips.org/kgio.git/tag/?h=v2.8.1),ruby 2.2.1 发布 2015 年 3 月(ruby-lang.org/en/news/2015/03/03/ruby-2-2-1-released)

    【讨论】:

    • 在过去的一个小时里,我一直在努力让我的旧 Rails 项目与 ruby​​ 2.3.1 一起工作。无论如何,谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-09-23
    • 2016-02-16
    • 2016-10-30
    • 2015-01-28
    • 2023-03-20
    • 2015-04-05
    相关资源
    最近更新 更多