I am unable to install the bson_ext 1.8.2 gem in my mongo project directory.
In specific I tried running bundle install and gem install bson_ext -v '1.8.2'
I tried other solutions present on the forum but in vain.
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 fails with the same error.
The solution here(https://jira.mongodb.org/browse/RUBY-551?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel) says its fixed....but i still face the same
Try updating rubygems and then installing bson_ext.
gem update --system
gem install bson_ext
I use ruby 2.0.0p0
When I installed bson-1.9.2.gem I got this error:
ERROR: Error installing bson_ext:
ERROR: Failed to build gem native extension.
/home/albert/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb
The following worked for me:
gem update --system
gem install bson_ext
Related
I've been trying to install msgpack using homebrew, and it repeatedly throw the following error:
Building native extensions. This could take a while...
ERROR: Error installing msgpack:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.4.0/gems/msgpack
0.5.8/ext/msgpack
/usr/local/opt/ruby/bin/ruby -r ./siteconf20170801-23901-1ar0ojr.rb extconf.rb
checking for ruby/st.h... yes
checking for st.h... yes
checking for rb_str_replace() in ruby.h... yes
creating Makefile
current directory: /usr/local/lib/ruby/gems/2.4.0/gems/msgpack-
0.5.8/ext/msgpack
make "DESTDIR=" clean
current directory: /usr/local/lib/ruby/gems/2.4.0/gems/msgpack-
0.5.8/ext/msgpack
make "DESTDIR="
compiling buffer.c
compiling buffer_class.c
compiling core_ext.c
core_ext.c:121:22: error: use of undeclared identifier 'rb_cFixnum'
rb_define_method(rb_cFixnum, "to_msgpack", Fixnum_to_msgpack, -1);
^
core_ext.c:122:22: error: use of undeclared identifier 'rb_cBignum'
rb_define_method(rb_cBignum, "to_msgpack", Bignum_to_msgpack, -1);
^
2 errors generated.
make: *** [core_ext.o] Error 1
make failed, exit code 2
Gem files will remain installed in
/usr/local/lib/ruby/gems/2.4.0/gems/msgpack-0.5.8 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-
16/2.4.0/msgpack-0.5.8/gem_make.out
Searching for the solution to this has been unfruitful. My Ruby version is 2.4.1, but I'm not sure if it's a version issue.
I found this issue in msgpack repository in Github:
https://github.com/msgpack/msgpack-ruby/issues/120
Looks like this issue was resolved in version 1.0.0.
Do you really need to use the version 0.5.8? Is it possible to update the gem version?
I'm getting an error installing syck on Ubuntu 15.04. Building the native extensions fails:
Installing syck 1.0.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/markus/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150618-8242-1z0c5iw.rb extconf.rb
checking for st.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling bytecode.c
compiling implicit.c
compiling token.c
token.re: In function ‘sycklex_yaml_utf8’:
token.re:541:36: warning: variable ‘lvl’ set but not used [-Wunused-but-set-variable]
compiling rubyext.c
rubyext.c:31:20: error: field ‘hash’ has incomplete type
struct RHash hash;
^
rubyext.c: In function ‘syck_seq_initialize’:
rubyext.c:1529:15: warning: variable ‘node’ set but not used [-Wunused-but-set-variable]
SyckNode *node;
^
Makefile:237: recipe for target 'rubyext.o' failed
make: *** [rubyext.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/markus/.rvm/gems/ruby-2.2.1#mygemset/gems/syck-1.0.1 for inspection.
Results logged to /home/markus/.rvm/gems/ruby-2.2.1#mygemset/extensions/x86_64-linux/2.2.0/syck-1.0.1/gem_make.out
An error occurred while installing syck (1.0.1), and Bundler cannot continue.
Make sure that `gem install syck -v '1.0.1'` succeeds before bundling.
Does someone have an idea what the issue is and how to fix it?
when I try to install the Ruby gem sequel_pg I get the following error meassage:
~$ sudo gem update
Updating installed gems
Updating sequel_pg
Building native extensions. This could take a while...
ERROR: Error installing sequel_pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
checking for main() in -lpq... yes
checking for libpq-fe.h... yes
checking for PQsetSingleRowMode()... no
creating Makefile
make
compiling sequel_pg.c
sequel_pg.c: In function ‘spg_timestamp_error’:
sequel_pg.c:279:3: error: format not a string literal and no format arguments [- Werror=format-security]
cc1: some warnings being treated as errors
make: *** [sequel_pg.o] Error 1
Gem files will remain installed in /var/lib/gems/1.9.1/gems/sequel_pg-1.6.5 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/sequel_pg-1.6.5/ext/sequel_pg/gem_make.out
Nothing to update
I am running Lubuntu 13.04. The depencies: pg and sequel are installed. Packages files postgresql and postgresql-server-dev-9.1 is also installed
Does anyone have a clue?
This bug was fixed in master of the gem with this patch. You should wait for new release or install head version of the gem.
In Ubuntu 12.10 when I run the following command
gem install caldecott
I get the following error message
Building native extensions. This could take a while...
ERROR: Error installing caldecott:
ERROR: Failed to build gem native extension.
/home/luisramalho/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb
creating Makefile
make
compiling generator.c
generator.c: In function ‘cState_aref’:
generator.c:632:5: warning: variable ‘state’ set but not used [-Wunused-but-set-variable]
generator.c: In function ‘isArrayOrObject’:
generator.c:867:5: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
linking shared-object json/ext/generator.so
make install
/usr/bin/install -c -m 0755 generator.so /home/luisramalho/.rvm/gems/ruby-2.0.0-p0/gems/json-1.6.8/ext/json/ext/json/ext
/usr/bin/install: cannot create regular file `/home/luisramalho/.rvm/gems/ruby-2.0.0-p0/gems/json-1.6.8/ext/json/ext/json/ext': No such file or directory
make: *** [install-so] Error 1
Gem files will remain installed in /home/luisramalho/.rvm/gems/ruby-2.0.0-p0/gems/json-1.6.8 for inspection.
Results logged to /home/luisramalho/.rvm/gems/ruby-2.0.0-p0/gems/json-1.6.8/ext/json/ext/generator/gem_make.out
Anyone has any idea what might be causing this?
Just to make it easier for the next person here is the soln from user comment here (https://github.com/appfog/af/issues/27#issuecomment-19190069) :
$ rvm install ruby-1.9.3-p484
$ rvm use 1.9.3
$ gem install af
[...]
$ gem install caldecott
[... long list of dependencies being installed which didn't happen for Ruby 2.0]
$ af login
$ af tunnel
When I tried to install vagrant gem in ruby 2.0.0-p0, I am getting follwoing error:
~ ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
~ gem -v
2.0.0.rc.2
~ gem list json
*** LOCAL GEMS ***
json (1.7.7)
~ gem install vagrant
Building native extensions. This could take a while...
ERROR: Error installing vagrant:
ERROR: Failed to build gem native extension.
/home/user_name/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb
checking for ruby/re.h... yes
checking for ruby/encoding.h... yes
creating Makefile
make
compiling generator.c
generator.c: In function ‘cState_aref’:
generator.c:736:5: warning: variable ‘state’ set but not used [-Wunused-but-set-variable]
linking shared-object json/ext/generator.so
make install
/usr/bin/install -c -m 0755 generator.so /home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/json-1.5.5/ext/json/ext/json/ext
/usr/bin/install: cannot create regular file `/home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/json-1.5.5/ext/json/ext/json/ext': No such file or directory
make: *** [install-so] Error 1
Gem files will remain installed in /home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/json-1.5.5 for inspection.
Results logged to /home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/json-1.5.5/ext/json/ext/generator/gem_make.out
I figure, its using json-1.5.5 from /home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/ while building the gem and getting the above error.
I tried re-installing the latest json-1.7.7 gem and still it fails to install.
Update your rubygems with: gem update --system
Here is the commit that fixed this issue: https://github.com/rubygems/rubygems/commit/1ca11d00833bbca33215ff581303d1fee8f2d1ef