Error installing debug_inspector 0.0.2 Native Extensions? - ruby

Getting this error when trying to do a bundle install. Following the instructions to do a direct gem install fails as well. I have since wiped all ruby (and project code) from my machine including any ruby configuration and reinstalled ruby, devkit, and my project code. Still getting this. Not sure where to look next. Most searches turn up gem-specific solutions that don't seem to apply here. Let me know if I can provide more info. Thanks!
An error occurred while installing debug_inspector (0.0.2), and Bundler cannot
continue.
Make sure that `gem install debug_inspector -v '0.0.2'` succeeds before
bundling.
C:\TFS\Grange Commercial SEQ\White\Specifications>gem install debug_inspector -v
'0.0.2'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
The system cannot find the path specified.
The system cannot find the path specified.
ERROR: Error installing debug_inspector:
ERROR: Failed to build gem native extension.
C:/devl/Ruby/Ruby192/bin/ruby.exe extconf.rb
Gem files will remain installed in C:/devl/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems
/debug_inspector-0.0.2 for inspection.
Results logged to C:/devl/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/debug_inspector-
0.0.2/ext/debug_inspector/gem_make.out

I know this question is very old. However, I see two problems with this right off.
Windows doesn't have the tools (by default, or using the ruby installer) to compile c dependencies for ruby. If you want to do it yourself, you might check out: http://rubylearning.com/blog/how-do-i-install-a-ruby-gem-with-native-extensions-on-windows/
The other problem is that this particular gem doesn't work with ruby < 2.0: https://github.com/banister/debug_inspector and your ruby version appears to be 1.9.1
I would check your Gemfile.lock to see which gems are requiring debug-inspector. If you can do without them, take them out, and your bundle will succeed. If you must have them, try running a linux VM and using it for your development. My personal suggestion would be Ubuntu: http://www.ubuntu.com/download/desktop and VirtualBox or VMWare Player. Virtual Box is FOSS, so if this is company work, you'll have to use it: https://www.virtualbox.org/ . VMWare Player is free for personal use, and I like how it works a little better: http://www.vmware.com/products/player

I got the same error, using Ruby 2.2.4 64bit, on windows 10 64.
In my case what caused the error was installing several ruby versions, one after the other- (to try and solve that error)
Eventually I solved it by running ruby dk.rb install --force (At first I did that without the force flag), as stated by this answer- Just make sure to use the correct ruby version- version that worked for me was ruby 2.1.7 32bit.

Related

Github pages installation: Jekyll -v output `require': cannot load such file -- google/protobuf_c (LoadError)

I'm trying to follow this guide on setting up a GitHub page website. I installed Homebrew, chruby, and Jekyll following this jekyllrb.com tutorial.
When I run ruby -v I get ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin18]. When I run chruby -V I get chruby: 0.3.9. After installing Jekyll with gem install jekyll I get Successfully installed jekyll-4.3.1 Parsing documentation for jekyll-4.3.1 Done installing documentation for Jekyll after 0 seconds 1 gem installed.
But when I run jekyll -v (or any Jekyll command) I get a very long message with the following error:
<internal:/Users/my_username/.rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': dlopen(/Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle, 9): no suitable image found. Did find: (LoadError)
/Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle: cannot load 'protobuf_c.bundle' (load command 0x80000034 is unknown)
/Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle: cannot load 'protobuf_c.bundle' (load command 0x80000034 is unknown) - /Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle
I spent hours looking at what this error means and found very specific (to some version of Ruby or other libraries) questions like Ruby 2.7.2 google/protobuf_c problem (M1), Ruby: Gem version 3.11.2 doesn't load on Ruby 2.7, and many others.
It's the first time I even hear about Ruby or Jekyll or anything else here and I can't figure out how to properly install these to just make a website on GitHub. I also tried to install Ruby using rvm instead of chruby but that gave the same error. I also tried to install different versions of Ruby, like 3.1.3 and 3.2.0.
When gems have native extensions that need to be compiled it's possible for the gem author to build the extensions in advance and include them in the package so that the gem can install faster than if it were being compiled from scratch. Unfortunately Google has broken this implementation repeatedly.
This has been a problem for about two years with google-protobuf. Google has periodically fixed it and broken it again. They also periodically claim to understand the problem without understanding it and claim to have fixed it without fixing it. And their GitHub issues frequently pass the buck when they're the only ones that can fix it.
Anytime you're dealing with google-protobuf on macOS it's best to ensure that you are compiling it from scratch. This can be done with the --platform argument:
gem install --platform ruby google-protobuf
The platform ruby means don't use any pre-compiled binaries and force compilation from source.
The platform x86_64-darwin means use the pre-compiled binaries for macOS with Intel processors. That's the version that the gem installer identified for your system and used automatically but the error no suitable image found is a macOS error that means this library was not compiled in a way that I can understand.

Ruby error on OS X Yosemite and chef

Getting this error when trying to install chef on OS X Yosemite, other gems have installed fine. Not seeing a requirement. Just wondering if anyone has and idea of what the issue is or has come across this.
$sudo gem install chef
Building native extensions. This could take a while...
ERROR: Error installing chef:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20141023-4708-6api21.rb extconf.rb
creating Makefile
/Library/Ruby/Gems/2.0.0/gems/libyajl2-1.1.0/ext/libyajl2
extconf.rb:104:in `makemakefiles': unhandled exception
from extconf.rb:138:in `<main>'
extconf failed, exit code 1
EDIT: Although my answer below will help you install it on the system version of Ruby. I would probably suggest using RVM instead as the comment below mentions. I do not use Ruby very often and it would probably be fine, but I decided to take the 10 mins to change it to installing to RVM since that way I leave the system ruby untouched.
As I was searching across the web, I could actually resolve this issue (which also appeared on docker/ubuntu) as suggested in this thread:
https://stackoverflow.com/a/32191707/1948319
Long story short: The gmp library is missing. You can install it on ubuntu with
sudo apt-get install libgmp3-dev
I had this problem with this gem specifically, and another gem with c extensions as well.
Turns out I needed to accept new terms & conditions after updating XCode :-)
sudo xcodebuild -license
So I actually answered my own question very shortly after I posted and I hope it helps someone else in the future.
I used this instead:
$ sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install chef
The Apple LLVM compiler in Xcode treats unrecognized command-line options as errors. This issue has been seen when building both Python native extensions and Ruby Gems, where some invalid compiler options are currently specified.
Came across this issue which was similar enough:
https://github.com/FontCustom/fontcustom/issues/194

Not able to install watir gem

I installed ruby186-27_rc2 and i am getting the same error as described in the Ruby: Cannot Install Watir Gem On Windows thread when i try to install watir using gem install watir. Please see the error below.
C:\DevKit>gem install watir
Building native extensions. This could take a while...
ERROR: Error installing watir:
ERROR: Failed to build gem native extension.
C:/Ruby/bin/ruby.exe extconf.rb
checking for strncpy_s()... no
creating Makefile.....
And then tried to install the devkit as suggested in the thread mentioned above. During the devkit installation i came up with a problem.
In step4 of devkit installation as described at Development Kit wiki i have added the path C:\Ruby to the config file and then ran the command ruby dk.rb install and i got the following error. Please help! Waiting for your inputs. Thanks!
C:/Ruby/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 15, col -1: `'
(ArgumentError)
from C:/Ruby/lib/ruby/1.8/yaml.rb:133:in `load'
from dk.rb:151:in `review'
from dk.rb:143:in `open'
from dk.rb:143:in `review'
from dk.rb:248:in `send'
from dk.rb:248:in `run'
from dk.rb:262
The DevKit contains a development environment for the MinGW port of MRI and YARV. You are using the MSVC6 port of MRI, so you need to install a development environment for MSVC6.
Unfortunately, there is no ready-made DevKit-like package for that. You will have to install it on your own. Note that it's not actually that hard to install, the biggest problem is to get a hold of a copy of Microsoft Visual C 6.0, since that hasn't been on sale for about 10 years now. You'll basically have to find someone who is going to sell you a used copy.
May I ask why you need to use a port of Ruby that hasn't been maintained in over 2 years, contains a version of Ruby that is so old that it cannot even run most modern code (e.g. Rails requires at least 1.8.7 or 1.9.2) and has several bugs, including security holes? Why don't you just use the MinGW port which is actually maintained?
This is all independent of the actual problem, of course, which is that you have a syntax error in your config.yml: you missed a dash and a space on line 15, which should read
- C:/Ruby
as indicated in the example section directly above it.

Installing ruby gems fails when attempting to build native

So I decided that I was going to give Ruby (first 1.9.1, then 1.8.7) a try and I wanted to get the basic tools installed before I attempted to do too much.
I have begun to install some gems, and I have run into some issues when I attempt to install one which builds native code on windows 7.
I was attempting to install the ruby debugger and linecache and each time I get the following make error: make: *** No rule to make target %RUBY_HOME%/include/ruby-1.9.1/ruby.h', needed bytrace_nums.o'.
My google-fu has not turned up anything very useful, so I am asking for the SO community to point me in the right direction. When I go used Ruby 1.8.7, i only attempted to install ruby-debug and linecache. When I was using 1.9.1, I attempted to use ruby-debug19 and linecache19. Since the issue is the same for both versions, I assume that it is something wrong on my end, but I do not know where to start.
For some reason, I needed to run the gem install from a Unix shell emulator from the devkit.
I don't know why it worked out the way it did, but this how I fixed the problem.

Error installing RedCloth

I'm getting this erron when trying to install RedCloth on openSuse:
sudo gem install RedCloth
Building native extensions. This could take a while...
ERROR: Error installing RedCloth:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
creating Makefile
make
sh: make: nie znaleziono polecenia
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/RedCloth-4.2.3 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/RedCloth-4.2.3/ext/redcloth_scan/gem_make.out
I tried to google this out and triend everything. So I need help with that.
I just had this same a similar problem and fixed it by installing the ruby dev package. For me, the command was:
sudo apt-get install ruby1.9.1-dev
I found the answer (and a better description of the problem) on this blog.
It's not the answer to this question exactly, but hopefully it'll be of use to someone else who stumbles upon this page.
If Google's Polish translation is correct, then you don't have make installed on your machine.
Try entering which make. If you see nothing, then you need to handle that first. I'm not sure the name of the package you need in OpenSuse. You should be able to search in Yum (Yast? whatever OpenSuse's package manager is called...) for something like Debian's 'build-essential' package.
Edit: In OpenSuse, the package you need seems to be called "C/C++ Development" (or "C/C++ Compiler and Tools"). See this thread for some pointers: http://forums.opensuse.org/applications/413553-build-essential.html
I don't know OpenSuse, but if it's anything like Debian, you can probably also install Ruby gems (and Perl and Python modules) directly from your package manager. This can be good and bad. Good because the package manager takes better care of dependencies and uninstalling (on average) than you would on your own. Bad because the distro will often have older versions than you might be able to get yourself. Still, it's an option to consider.
If using Windows and RubyInstaller.org, I believe you need to install the devkit they provide.
If you have make after checking with which make and you are sure you have ruby installed by checking which ruby it could be that you had installed something similar to sudo apt-get install ruby1.9.1-dev and then changed your mind and removed that because now you use rbenv or rvm or just installed from source. The problem is that the reference to /var/lib/ruby/1.9.1/ will still be associated with ruby gem and will try to install the gems there. Solution could be to remove that directory sudo rm -rf /var/lib/ruby/1.9.1/ and that could fix the issue.

Resources