0

我正在尝试在我的系统中设置一个 ruby​​ 2.3.0 项目。运行bundle install时,我收到以下错误:-

Fetching bson_ext 1.5.1
Installing bson_ext 1.5.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/admin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bson_ext-1.5.1/ext/cbson
/Users/admin/.rbenv/versions/2.3.0/bin/ruby -I /Users/admin/.rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0 -r ./siteconf20201009-77301-z7iyto.rb
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

current directory: /Users/admin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bson_ext-1.5.1/ext/cbson
make "DESTDIR=" clean

current directory: /Users/admin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bson_ext-1.5.1/ext/cbson
make "DESTDIR="
compiling encoding_helpers.c
compiling cbson.c
cbson.c:118:36: warning: passing 'char *' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
    result_t status = check_string(RSTRING_PTR(string), RSTRING_LEN(string),
                                   ^~~~~~~~~~~~~~~~~~~
/Users/admin/.rbenv/versions/2.3.0/include/ruby-2.3.0/ruby/ruby.h:994:5: note: expanded from macro 'RSTRING_PTR'
    (!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./encoding_helpers.h:26:44: note: passing argument to parameter 'string' here
result_t check_string(const unsigned char* string, const int length,
                                           ^
cbson.c:602:18: error: implicit declaration of function 'bson_buffer_get_max_size' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if (length > bson_buffer_get_max_size(buffer)) {
                 ^
cbson.c:602:18: note: did you mean 'bson_buffer_set_max_size'?
./bson_buffer.h:34:6: note: 'bson_buffer_set_max_size' declared here
void bson_buffer_set_max_size(bson_buffer_t buffer, int max_size);
     ^
1 warning and 1 error generated.
make: *** [cbson.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/admin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bson_ext-1.5.1 for inspection.
Results logged to /Users/admin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-18/2.3.0-static/bson_ext-1.5.1/gem_make.out

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

In Gemfile:
  bson_ext

更改 bson_ext 版本不起作用。我特别需要该项目的 1.5.1 版本。请帮忙 !!!

4

0 回答 0