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"
Related
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).
I've been on this for a few hrs already googled everything. Tried tons of answers, im using ruby x64 and devkit x64 (originaly isntalled the incorect one x32 but i just deleted it and installed the correct one x64)
Cant install json or (my actual target) ruby-debug-ide -v 0.4.32
gem version = 2.4.7
ruby version =ruby 2.4.2p198 (2017-09-14 revision 59899) [x64-mingw32]
C:\WINDOWS\system32>gem install json
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20171013-12212-1y42085.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
generating generator-x64-mingw32.def
compiling generator.c
linking shared-object json/ext/generator.so
c:/ruby24-x64/programing/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgmp
collect2.exe: error: ld returned 1 exit status
make: *** [generator.so] Error 1
make failed, exit code 2
Gem files will remain installed in C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/json-2.1.0 for inspection.
Results logged to C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/json-2.1.0/gem_make.out
You might want to try a cloud9 editor, and per this tutorial https://www.railstutorial.org/book/beginning
It will save you quite a bit of pain setting up your rails environment.
I'm trying to install Ruby/JSON on Mac OS X 10.11.
However, the gem install command gives the error message:
smcho#macho ruby-rails-sample> gem install json
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/Users/smcho/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20151025-39148-au2m2x.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling generator.c
linking shared-object json/ext/generator.bundle
ld: warning: directory not found for option '-L/Users/haven/.sm/pkg/active/lib'
make "DESTDIR=" install
./install -m 0755 generator.bundle ./.gem.20151025-39148-i7g03f/json/ext
make: ./install: No such file or directory
make: *** [install-so] Error 1
make install failed, exit code 2
Gem files will remain installed in /Users/smcho/.rvm/gems/ruby-2.2.1/gems/json-1.8.3 for inspection.
Results logged to /Users/smcho/.rvm/gems/ruby-2.2.1/extensions/x86_64-darwin-14/2.2.0-static/json-1.8.3/gem_make.out
The message says make: ./install: No such file or directory, but I'm not sure how to fix this issue.
Is this a known issue, or is there a way to bypass this one?
This is my system version. I executed gem update --system to get the latest version.
> ruby -v
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
> gem -v
2.4.8
I should have used the latest ruby (2.2.3) not the old one (2.2.1)
ruby-rails-sample> rvm --default use 2.2.3
Using /Users/smcho/.rvm/gems/ruby-2.2.3
smcho#macho ruby-rails-sample> gem install json
Building native extensions. This could take a while...
Successfully installed json-1.8.3
Parsing documentation for json-1.8.3
Installing ri documentation for json-1.8.3
Done installing documentation for json after 1 seconds
1 gem installed
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.
I am having a problem getting my ruby system up and running. Specifically, I get the following error when trying
gem install json
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
creating Makefile
make
generating parser-i386-mingw32.def
compiling parser.c
gcc.exe: CreateProcess: No such file or directory
make: *** [parser.o] Error 1
Gem files will remain installed in c:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.6.
Results logged to c:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.6.3/ext/json/ext/pa
I know that my gcc works. I don't get the same error when installing
`gem install json_pure
However, when I try a
bundle install
I get the error. I am extremely new to ruby and rails, so any help would be appreciated.
install devkit with --force option