ruby - 无法安装 bson_ext 1.8.2 gem

标签 ruby gem bson bson-ext

我无法在我的 mongo 项目目录中安装 bson_ext 1.8.2 gem。 具体来说,我尝试运行 bundle installgem install bson_ext -v '1.8.2'

我尝试了论坛上提供的其他解决方案,但没有成功。

Installing bson_ext (1.8.2) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /home/jayanth/.rvm/rubies/ruby-2.0.0-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 encoding_helpers.c
compiling cbson.c
cbson.c: In function ‘write_utf8’:
cbson.c:118:36: warning: pointer targets in passing argument 1 of ‘check_string’ differ in signedness [-Wpointer-sign]
In file included from cbson.c:66:0:
encoding_helpers.h:26:10: note: expected ‘const unsigned char *’ but argument is of type ‘char *’
cbson.c: In function ‘write_element’:
cbson.c:301:20: warning: unused variable ‘values’ [-Wunused-variable]
cbson.c: In function ‘objectid_generate’:
cbson.c:936:9: warning: implicit declaration of function ‘htonl’ [-Wimplicit-function-declaration]
cbson.c:944:5: warning: implicit declaration of function ‘htons’ [-Wimplicit-function-declaration]
cbson.c: In function ‘write_element’:
cbson.c:316:17: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
linking shared-object bson_ext/cbson.so

make install
/usr/bin/install -c -m 0755 cbson.so /home/jayanth/.rvm/gems/ruby-2.0.0-p0@mongo-tools/gems/bson_ext-1.8.2/ext/bson_ext/bson_ext
/usr/bin/install: cannot create regular file `/home/jayanth/.rvm/gems/ruby-2.0.0-p0@mongo-tools/gems/bson_ext-1.8.2/ext/bson_ext/bson_ext': No such file or directory
make: *** [install-so] Error 1


Gem files will remain installed in /home/jayanth/.rvm/gems/ruby-2.0.0-p0@mongo-tools/gems/bson_ext-1.8.2 for inspection.
Results logged to /home/jayanth/.rvm/gems/ruby-2.0.0-p0@mongo-tools/gems/bson_ext-1.8.2/ext/cbson/gem_make.out

An error occurred while installing bson_ext (1.8.2), and Bundler cannot continue.
Make sure that `gem install bson_ext -v '1.8.2'` succeeds before bundling.

gem install bson_ext -v '1.8.2 失败并出现同样的错误。

这里的解决方案(https://jira.mongodb.org/browse/RUBY-551?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel)说它是固定的....但我仍然面临同样的问题

最佳答案

尝试更新 ruby​​gems,然后安装 bson_ext。

gem update --system
gem install bson_ext

关于ruby - 无法安装 bson_ext 1.8.2 gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15266444/

相关文章:

c - mongodb c-api 中的 $exists 查询

ruby - 在 Go (golang) 中编写一个 Ruby 扩展

ruby - 珠宝商向我的 gem 添加循环依赖

ruby-on-rails - RoR Rake - 关于 gem 的数据库错误

go - 将ptypes/struct值转换为BSON

java - MongoDB Java驱动程序: Undefined values are not shown

ruby - 将复杂文件拆分为哈希

ruby-on-rails - 如何使用不同的名称为同一个模型创建两个关系?

ruby-on-rails - 搜索栏 Ruby On Rails 的问题

ruby - 导轨 : how to get a file extension/postfix based on the mime type