1

我对 ruby​​、rvm、gems 等术语很陌生;但我正在尝试在 Ubuntu 12.10 服务器上安装 Discourse。我已经安装了所有的宝石bundle install,除了一个,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

我不知道从这里去哪里?

4

2 回答 2

4

在您的Gemfile替换行中:

gem 'fast_xor'

对于以下一个(从已修复错误的 Git 存储库中提取 fast_xor):

gem "fast_xor", :git => "git://github.com/CodeMonkeySteve/fast_xor.git"

如果由于某种原因 git 协议在您的网络中被防火墙(如我的情况),那么您可以用 HTTPS 替换它:

gem "fast_xor", :git => "https://github.com/CodeMonkeySteve/fast_xor.git"
于 2013-03-25T16:51:22.973 回答
-3

这是 gem 中的一个错误:https ://github.com/CodeMonkeySteve/fast_xor/issues/5

在提问之前始终检查项目的问题跟踪器 - stavkoverflow 用于解决问题而不是报告错误。

于 2013-03-23T09:07:13.397 回答