質問

I'm very new to terms like ruby, rvm, gems; but I'm trying to get Discourse installed on an Ubuntu 12.10 server. I have all gems installed using bundle install, save for one, 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.

I have checked out the fast_xor project from Git, but I receive a similar error when compiling from source.

An rvm list only lists one version of Ruby:

ubuntu@ip-10-245-40-185:~/discourse$ rvm list

rvm rubies

=* ruby-2.0.0-p0 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

I'm not sure where to go from here?

役に立ちましたか?

解決 2

It's a bug in the gem: https://github.com/CodeMonkeySteve/fast_xor/issues/5

Always check the issue tracker of a project before asking questions - stavkoverflow is for solving problems not reporting bugs.

他のヒント

In your Gemfile replace the line:

gem 'fast_xor'

For the following one (to pull fast_xor from the Git repository, which has the bug fixed):

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

If for whatever reason the git protocol is firewalled in your network (as is my case), then you can replace it with HTTPS:

gem "fast_xor", :git => "https://github.com/CodeMonkeySteve/fast_xor.git"
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top