我正在尝试将 Rails 从 3.1.3 更新到 3.2.8。更改 rails gem 值并运行“bundle update rails”会尝试安装名为“termios”版本 0.9.4 的 gem,但失败并显示以下消息:
Installing termios (0.9.4) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/me/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
checking for termios.h... yes
checking for unistd.h... yes
creating Makefile
make
compiling termios.c
In file included from termios.c:10:
/Users/me/.rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/ruby/backward/rubyio.h:2:2: warning: #warning use "ruby/io.h" instead of "rubyio.h"
termios.c: In function ‘Termios_to_termios’:
termios.c:182: error: ‘struct RArray’ has no member named ‘ptr’
termios.c:183: error: ‘struct RArray’ has no member named ‘ptr’
termios.c: In function ‘termios_tcgetattr’:
termios.c:200: error: ‘OpenFile’ undeclared (first use in this function)
make: *** [termios.o] Error 1
Gem files will remain installed in /Users/me/.rvm/gems/ruby-1.9.3-p0@mcp5/gems/termios-0.9.4 for inspection.
Results logged to /Users/me/.rvm/gems/ruby-1.9.3-p0@mcp5/gems/termios-0.9.4/./gem_make.out
An error occured while installing termios (0.9.4), and Bundler cannot continue.
Make sure that `gem install termios -v '0.9.4'` succeeds before bundling.
另请注意,这是我自从使用 OS X Mountain Lion 以来第一次更新 Rails。
我已经看到关于这个问题的另一个答案,它说要安装一个名为“ruby-termios”的gem。我这样做了,并且那个 gem 安装得很好,但是在某个地方仍然有一个依赖项试图安装“termios”gem。