为什么在安装bson_ext时出现错误? [英] Why do I get an error installing bson_ext?

查看:157
本文介绍了为什么在安装bson_ext时出现错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Rails项目文件夹中执行以下命令时:

When I execute the following command in the Rails project folder:

gem install bson_ext

我收到此错误:

#result
Building native extensions.  This could take a while...
ERROR:  Error installing bson_ext:
    ERROR: Failed to build gem native extension.

    /home/absolute/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
checking for asprintf()... yes
checking for ruby/st.h... yes
checking for ruby/regex.h... yes
checking for ruby/encoding.h... yes
creating Makefile

make
compiling bson_buffer.c
compiling cbson.c
cbson.c: In function ‘write_element’:
cbson.c:439:17: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-    after-statement]
cbson.c: In function ‘write_doc’:
cbson.c:608:5: warning: implicit declaration of function ‘bson_buffer_get_max_size’     [-Wimplicit-function-declaration]
cbson.c: In function ‘objectid_generate’:
cbson.c:911:9: warning: implicit declaration of function ‘htonl’ [-Wimplicit-function-declaration]
cbson.c:919:5: warning: implicit declaration of function ‘htons’ [-Wimplicit-function-declaration]
compiling encoding_helpers.c
linking shared-object bson_ext/cbson.so

make install
/bin/install -c -m 0755 cbson.so /home/absolute/.rvm/gems/ruby-1.9.3-p0/gems/bson_ext-1.6.2/ext/bson_ext
make: /bin/install: Command not found
make: *** [/home/absolute/.rvm/gems/ruby-1.9.3-p0/gems/bson_ext-1.6.2/ext/bson_ext/cbson.so] Error 127


Gem files will remain installed in /home/absolute/.rvm/gems/ruby-1.9.3- p0/gems/bson_ext-1.6.2 for inspection.
Results logged to /home/absolute/.rvm/gems/ruby-1.9.3-p0/gems/bson_ext-1.6.2/ext/cbson/gem_make.out

我在Rails项目中使用蒙古包.安装bson_ext gem,它给了我上面的错误.

I am using mongoid in my Rails project. Installing the bson_ext gem, it gives me the above error.

有人可以告诉我这是什么问题吗?

Can anybody tell me what is the problem?

推荐答案

不确定为什么您的make使用的不是正确的install.但是,快速修复很容易:

Not sure why your make is not using the correct install. But it's easy to do a quick fix:

sudo ln -s /usr/bin/install /bin/install

这会将现有安装链接到/bin,并应启用make继续.

This will link the existing install into /bin and should enable make to continue.

这篇关于为什么在安装bson_ext时出现错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆