我对 ruby、rvm、gems 等术语很陌生;但我正在尝试在 Ubuntu 12.10 服务器上安装 Discourse。我使用 bundle install
安装了所有 gem,除了一个,fast_xor
:
Installing fast_xor (1.1.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/ubuntu/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb
creating Makefile
make
compiling xor.c
xor.c: In function ‘string_xor’:
xor.c:28:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
xor.c:45:7: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
linking shared-object xor.so
make install
/usr/bin/install -c -m 0755 xor.so /home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/fast_xor-1.1.1/lib/fast_xor
/usr/bin/install: cannot create regular file `/home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/fast_xor-1.1.1/lib/fast_xor': No such file or directory
make: *** [install-so] Error 1
Gem files will remain installed in /home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/fast_xor-1.1.1 for inspection.
Results logged to /home/ubuntu/.rvm/gems/ruby-2.0.0-p0/gems/fast_xor-1.1.1/ext/xor/gem_make.out
An error occurred while installing fast_xor (1.1.1), and Bundler cannot continue.
Make sure that `gem install fast_xor -v '1.1.1'` succeeds before bundling.
我已经从 Git 中检查了 fast_xor
项目,但是从源代码编译时我收到了类似的错误。
rvm list
只列出一个 Ruby 版本:
ubuntu@ip-10-245-40-185:~/discourse$ rvm list
rvm rubies
=* ruby-2.0.0-p0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
我不确定从这里到哪里去?
在你的 Gemfile
中替换行:
gem 'fast_xor'
对于以下一个(从修复了错误的 Git 存储库中提取 fast_xor):
gem "fast_xor", :git => "git://github.com/CodeMonkeySteve/fast_xor.git"
如果出于某种原因 git 协议(protocol)在您的网络中受到防火墙保护(就像我的情况),那么您可以将其替换为 HTTPS:
gem "fast_xor", :git => "https://github.com/CodeMonkeySteve/fast_xor.git"
我是一名优秀的程序员,十分优秀!