无法在Ubuntu上安装fast_xor Gem for Discourse

时间:2013-03-22 22:52:31

标签: ruby ubuntu rvm ubuntu-12.10 ruby-2.0

我对像ruby,rvm,gem这样的术语很新;但我正试图在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

我不确定从哪里开始?

2 个答案:

答案 0 :(得分: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"

答案 1 :(得分:-3)

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

在提出问题之前,请务必检查项目的问题跟踪器 - stavkoverflow用于解决不报告错误的问题。