error occurred while installing crypt (3.1.7) - ruby

I have an error message while running sudo bundle install:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for ruby/util.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling bcrypt_ext.c
compiling crypt.c
compiling crypt_blowfish.c
compiling crypt_gensalt.c
compiling wrapper.c
linking shared-object bcrypt_ext.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [bcrypt_ext.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/bcrypt-3.1.7 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/bcrypt-3.1.7/gem_make.out
An error occurred while installing bcrypt (3.1.7), and Bundler cannot continue.
Make sure that `gem install bcrypt -v '3.1.7'` succeeds before bundling.
Then I tried to run sudo gem install bcrypt -v '3.1.7' and have below error message:
Building native extensions. This could take a while...
ERROR: Error installing bcrypt:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for ruby/util.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling bcrypt_ext.c
compiling crypt.c
compiling crypt_blowfish.c
compiling crypt_gensalt.c
compiling wrapper.c
linking shared-object bcrypt_ext.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [bcrypt_ext.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/bcrypt-3.1.7 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/bcrypt-3.1.7/gem_make.out
After this, I try to run sudo gem install bcrypt, still not working. Any tips?

I had upgraded Xcode from the Mac App Store, and that caused this particular error for me.
The way to fix it in my case: run Xcode and accept the license terms, etc. Then when I ran bundle install, it compiled and installed bcrypt just fine.

Related

foodcritic (3.0.3) gem installation is failing in Mac OS High Sierra

My food critic gem installation is failing with the below error
Following gems were not installed:
foodcritic (3.0.3): Error installing foodcritic
ERROR: Failed to build gem native extension. current directory
/Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yajl-ruby-1.1.0/ext/yajl
/Users/dmanna/.rbenv/versions/2.5.1/bin/ruby -r ./siteconf/20180729-63637-1dtcegj.rb.extconf.rb creating Makefile current
directory: /Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yajl-ruby-1.1.0/ext/yajl make "DESTDIR=" clean current
directory: /Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yajl-ruby-1.1.0/ext/yajl make "DESTDIR=" compiling
yajl.c compiling yajl_alloc.c compiling yajl_buf.c compiling yajl_encode.c compiling yajl_ext.c yajl_ext.c:852:22 error: use of undeclared identifier 'rb_cFixnum' rb_define_method(rb_cFixnum, "to_json", rb_yajl_json_ext_fixnum_to_json, -1); ^ 1 error generated.
make: *** [yajl_ext.o] Error 1 make failed, exit code 2 Gem files remain installed in
/Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yajl-ruby-1.1.0 for inspection. Results logged to
/Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/yajl-ruby-1.1.0/gem_make.out
Output of gem_make.out
current directory: /Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yajl-ruby-1.1.0/ext/yajl
/Users/dmanna/.rbenv/versions/2.5.1/bin/ruby -r ./siteconf20180729-63637-1dtcegj.rb extconf.rb
creating Makefile
current directory: /Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yajl-ruby-1.1.0/ext/yajl
make "DESTDIR=" clean
current directory: /Users/dmanna/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/yajl-ruby-1.1.0/ext/yajl
make "DESTDIR="
compiling yajl.c
compiling yajl_alloc.c
compiling yajl_buf.c
compiling yajl_encode.c
compiling yajl_ext.c
yajl_ext.c:852:22: error: use of undeclared identifier 'rb_cFixnum'
rb_define_method(rb_cFixnum, "to_json", rb_yajl_json_ext_fixnum_to_json, -1);
^
1 error generated.
make: *** [yajl_ext.o] Error 1
make failed, exit code 2
rbenv version - 2.5.1 OS
Mac 10.13.6
I am new to ruby. I am getting this error when trying to import a project in RubyMine and installing the gems.
Can someone let me know what is going wrong and how can I get around this?
Foodcritic 3.0.3 is from 2013. See here:
https://rubygems.org/gems/foodcritic/versions/3.0.3
Unfortunately it is not compatible with the latest version of Ruby. Your choices are to either downgrade Ruby to something less than 2.4, maybe even as low as 1.9 to be sure of compatibility, or upgrade foodcritic to its latest version (14.0.0).

Install msgpack (0.5.8) using homebrew mac OSX error

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?

How to install syck 1.0.1 on Ubuntu 15.04?

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?

Install json failed on windows

I got this issue when I install json by gem install on windows, and the error message is:
C:\DevKit>gem install json --platform=ruby --version=1.4.6
Fetching: json-1.4.6.gem (100%)Fetching: json-1.4.6.gem
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
checking for ruby/re.h... yes
checking for ruby/encoding.h... yes
creating Makefile
make "DESTDIR="
generating generator-i386-mingw32.def
compiling generator.c
generator.c:321:13: warning: 'fbuffer_free_only_buffer' defined but not used
linking shared-object json/ext/generator.so
c:/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lmsvcrt-ruby191
collect2: ld returned 1 exit status
make: *** [generator.so] Error 1
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.4.6 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/json- 1.4.6/ext/json/ext/generator/gem_make.out
and whatis -lmsvcrt-ruby191, Is that a lib of ruby? From the error message it says cannot find -lmsvcrt-ruby191, that is arch-criminal?
I install json, because I want to make sure DevKit is installed successfully.
Can anybody help me?

Unable to install therubyracer

I am trying to do a gem install therubyracer on Debian 6. I am using rbenv on 1.9.3. When I initially did it, it complained about libv8, so I did a gem install libv8. Now, when I run gem install therubyracer, I get the following error saying it can't find the file. The file it's talking about, /home/chop/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/libv8-3.11.8.3-x86_64-linux/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a, does exist however.
hop#fev-temp:~$ gem install therubyracer
Building native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
/home/chop/.rbenv/versions/1.9.3-p327/bin/ruby extconf.rb
checking for main() in -lpthread... yes
creating Makefile
make
compiling stack.cc
compiling accessor.cc
compiling constants.cc
compiling heap.cc
compiling init.cc
compiling primitive.cc
compiling signature.cc
compiling date.cc
compiling locker.cc
compiling exception.cc
compiling gc.cc
compiling script.cc
compiling external.cc
compiling v8.cc
compiling object.cc
compiling trycatch.cc
compiling context.cc
compiling string.cc
compiling value.cc
compiling array.cc
compiling invocation.cc
compiling message.cc
compiling constraints.cc
compiling function.cc
compiling backref.cc
compiling handles.cc
compiling template.cc
compiling rr.cc
linking shared-object v8/init.so
/home/chop/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/libv8-3.11.8.3-x86_64-linux/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a: could not read symbols: No such file or directory
collect2: ld returned 1 exit status
make: *** [init.so] Error 1
Gem files will remain installed in /home/chop/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0 for inspection.
Results logged to /home/chop/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0/ext/v8/gem_make.out
I just hit the exact same error. I looked at the gem details at https://rubygems.org/gems/therubyracer and it seems we were "lucky" enough to bundle a new version on the release day.
This appears to already be reported: https://github.com/cowboyd/therubyracer/issues/215
So, I figured the easiest thing is to use the last version of the gem. So I updated my Gemfile to point to the last version like so:
gem "therubyracer", "~> 0.10.2"
and I was able to successfully install the gem.
If you want to manually install the gem, you can use:
gem install therubyracer --version "~> 0.10.2"

Resources