Error installing debugger-linecache in Ruby 1.9.3 - ruby

I need version 1.0.1 of debugger-linecache for a project, and I am facing the following error when trying to install.
trunk ☺ gem install debugger-linecache -v '1.0.1'
Building native extensions. This could take a while...
ERROR: Error installing debugger-linecache:
ERROR: Failed to build gem native extension.
/Users/jordanscales/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
Makefile creation failed
**************************************************************************
No source for ruby-1.9.3-p194 provided with debugger-ruby_core_source gem.
**************************************************************************
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/jordanscales/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include
--without-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
Gem files will remain installed in /Users/jordanscales/.rvm/gems/ruby-1.9.3-p194/gems/debugger-linecache-1.0.1 for inspection.
Results logged to /Users/jordanscales/.rvm/gems/ruby-1.9.3-p194/gems/debugger-linecache-1.0.1/ext/trace_nums/gem_make.out
trunk ☺
Any help would be extremely appreciated, I have been searching but cannot find a working solution.

this may help you, it works for me
gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p286/

This error means that the selected version of debugger does not support your current Ruby version. There are two solutions:
Update the debugger gem via bundle update debugger. New versions of debugger are backward-compatible with old Ruby versions, so this is the best way to fix it.
Downgrade your Ruby version.

Update/Install the gem debugger-ruby_core_source,
gem install debugger-ruby_core_source
it has been corrected here : https://github.com/cldwalker/debugger-ruby_core_source/pull/7

The problem was that I was using gemsets incorrectly. I knew not having permissions were an issue, as under RVM I shouldn't need sudo to install anything.
rvm gemset use global and then a bundle install did the trick.

From the below link:
https://github.com/cldwalker/debugger/issues/50
I have installed gem ruby-debug19 and problem solved for me as below:
$ bundle
... -> failed to build debugger-linecache
$ gem install ruby-debug19
$ bundle
... -> all is fine

In my case problem was not related to debugger-linecache directly. Either try upgrading debugger-ruby_core_source or downgrade Ruby by few patchlevels.
I've executed bundle update debugger-linecache. Although I had its newest version in Gemfile.lock, debugger-ruby_core_source has been upgraded to 1.1.5 and debugger-linecache has stopped complaining.

I installed debugger-ruby_core_source gem, based on perusing old answers here: https://github.com/cldwalker/debugger/issues/12

If you are using rvm, then make sure the path lead to ruby, in rvm its rubies folder
$rvm_path/rubies/ruby-1.9.3-p448
gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/rubies/ruby-1.9.3-p448

Your Gemfile.lock wasn't written with the same Ruby that you're trying to bundle against.
bundle update should work by making Bundler look at different versions.

manually build it. it works for me
https://gist.github.com/4060260

Related

Trouble with gem installations

I am in a coding bootcamp and I have encountered an error in which I am having a hard time fixing. I currently in an exercise where I am learning how to create dynamic routes. Every time I run my server I am getting errors when I go to my routes and it states that:
Could not find nokogiri-1.8.2 in any of the sources
Run `bundle install` to install missing gems.
I tried to bundle install after adding nokogiri to my gemfile but all I get is this error below. I need some help cause I don't know what is going on and I am a total noob in regards to this stuff.
Ignoring unf_ext-0.0.7.5 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.7.5
Ignoring websocket-driver-0.7.0 because its extensions are not built. Try: gem pristine websocket-driver --version 0.7.0
Fetching gem metadata from http://rubygems.org/........
Using rake 12.3.0
Using concurrent-ruby 1.0.5
Using i18n 0.9.5
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.1.5
Using activemodel 5.1.5
Using arel 8.0.0
Using activerecord 5.1.5
Using public_suffix 3.0.2
Using addressable 2.5.2
Using bundler 1.16.6
Using mini_mime 1.0.0
Using mini_portile2 2.3.0
Fetching nokogiri 1.8.2
Installing nokogiri 1.8.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/Users/kenkuts/.rvm/gems/ruby-2.5.0/gems/nokogiri-1.8.2/ext/nokogiri
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r
./siteconf20181215-54662-1izm05e.rb extconf.rb --use-system-libraries
Ignoring unf_ext-0.0.7.5 because its extensions are not built. Try: gem pristine
unf_ext --version 0.0.7.5
Ignoring websocket-driver-0.7.0 because its extensions are not built. Try: gem
pristine websocket-driver --version 0.7.0
checking if the C compiler accepts ... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/$(RUBY_BASE_NAME)
--help
--clean
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:456:in
`try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:571:in
`block in try_compile'
from
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:522:in
`with_werror'
from
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:571:in
`try_compile'
from extconf.rb:138:in `nokogiri_try_compile'
from extconf.rb:162:in `block in add_cflags'
from
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:629:in
`with_cflags'
from extconf.rb:161:in `add_cflags'
from extconf.rb:410:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
/Users/kenkuts/.rvm/gems/ruby-2.5.0/extensions/universal-darwin-18/2.3.0/nokogiri-1.8.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/Users/kenkuts/.rvm/gems/ruby-2.5.0/gems/nokogiri-1.8.2 for inspection.
Results logged to
/Users/kenkuts/.rvm/gems/ruby-2.5.0/extensions/universal-darwin-18/2.3.0/nokogiri-1.8.2/gem_make.out
An error occurred while installing nokogiri (1.8.2), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.8.2' --source 'http://rubygems.org/'`
succeeds before bundling.
In Gemfile:
capybara was resolved to 2.18.0, which depends on
xpath was resolved to 3.0.0, which depends on
nokogiri
You may need to download Xcode from the App Store, and run the commands
xcode-select --install
sudo xcodebuild -license`
The nokogiri install instructions mention this:
https://www.nokogiri.org/tutorials/installing_nokogiri.html#install_with_included_libraries__recommended_
This isn't an "answer" as much as a set of (hopefully) helpful things too long for a comment.
Sandbox your gems
I always run bundler in the following way now, so that one project's dependencies have no impact on the gems I use system wide or on other projects:
bundle install --binstubs --path=vendor.noindex
That will put all executables in PROJECT_DIR/bin and all gems in PROJECT_DIR/vendor.noindex. The "noindex" bit stops Spotlight from indexing the gems. To run rspec would now be:
bin/rspec
To start from a clean slate I run:
rm -rf .bundle bin Gemfile.lock vendor.noindex
Note: Always be careful using an rm -rf!!!!
Installing and finding dependencies
The last time I installed Nokogiri using the gem install command it looked like this:
gem install nokogiri -- \
--use-system-libraries \
--with-xml2-include=/opt/pkg/include/libxml2 \
--with-xml2-lib=/opt/pkg/lib \
--with-xslt-include=/opt/pkg/include/libxslt \
--with-xslt-lib=/opt/pkg/lib
As other commenters have noticed, this shows that you need XCode installed (always worth checking for updates) and that I've used libraries installed by another package manager (I've used pkgrsc above though you could use Macports or Homebrew and maybe some others).
To find the libs you need to link to try running:
find `/usr` -name libxml2 -type d 2> >(grep -v 'Permission denied' >&2)
Or change the /usr to /opt if you're installing there via pkgsrc/Macports/Fink etc. You may need to put a sudo in front depending on the permissions.
There's also the locate command, e.g.
locate libxml2
Which will bring up lots of stuff.

Bundle install fails to install libxml-ruby

I'm a new to Ruby world and I need to clone an existing project.
The instructions are:
source .env.development
bundle install
But it fails with:
Using libv8 3.16.14.15
Fetching libxml-ruby 2.9.0
Installing libxml-ruby 2.9.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/vlad/.rvm/gems/ruby-2.3.1/gems/libxml-ruby-2.9.0/ext/libxml
/Users/vlad/.rvm/rubies/ruby-2.3.1/bin/ruby -r ./siteconf20181109-46682-fvgifh.rb extconf.rb --use-system-libraries
checking for libxml/xmlversion.h in /opt/include/libxml2,/opt/local/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/vlad/.rvm/rubies/ruby-2.3.1/bin/$(RUBY_BASE_NAME)
--with-xml2-config
--without-xml2-config
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
extconf failure: need libxml2.
Install the library or try one of the following options to extconf.rb:
--with-xml2-config=/path/to/xml2-config
--with-xml2-dir=/path/to/libxml2
--with-xml2-lib=/path/to/libxml2/lib
--with-xml2-include=/path/to/libxml2/include
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/vlad/.rvm/gems/ruby-2.3.1/extensions/x86_64-darwin-18/2.3.0/libxml-ruby-2.9.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/vlad/.rvm/gems/ruby-2.3.1/gems/libxml-ruby-2.9.0 for inspection.
Results logged to /Users/vlad/.rvm/gems/ruby-2.3.1/extensions/x86_64-darwin-18/2.3.0/libxml-ruby-2.9.0/gem_make.out
An error occurred while installing libxml-ruby (2.9.0), and Bundler cannot continue.
Make sure that `gem install libxml-ruby -v '2.9.0'` succeeds before bundling.
In Gemfile:
upnxt_community_lib_common was resolved to 1.7.49, which depends on
upnxt_processing_lib_document was resolved to 2.0.0, which depends on
libxml-
If I want to execute the command that is suggested "gem install libxml-ruby -v '2.9.0'" I get the same error.
Operating System: MacOS Mojave, version 10.14.
Ruby version needed for the project: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin18]
I also tried this but it didn't helped.
Thanks in advance for any help!
These steps worked for me (source)
brew install libxml2
bundle config --global build.libxml-ruby --with-xml2-config="$(brew --prefix libxml2)/bin/xml2-config"
then bundle install worked as expected
I manage to fix this with the help of a colleague, if anybody else encounter this problem:
gem install libxml-ruby -v '2.9.0' -- --use-system-libraries --with-xml2-dir=/usr/local/Cellar/libxml2/2.9.8/include/libxml2/libxml/ --with-xml2-config=/usr/bin/xml2-config
Replace '2.9.0' with the libxml version that you need!
It solved for me in mac by running
gem install libxml-ruby -v '3.0.0' -- --with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config --with-xml2-dir=/usr/local/opt/libxml2 --with-xml2-lib=/usr/local/opt/libxml2/lib --with-xml2-include=/usr/local/opt/libxml2/include
Just happened today.
$ brew link --force libxml2
Warning: Refusing to link macOS-provided software: libxml2
...
At first, I wasn't aware that there's a warning and it doesn't work anymore.
Then found this workaround and it worked for me.
bundle config build.libxml-ruby --use-system-libraries=true --with-xml2-include=/usr/local/opt/libxml2/include/libxml2/
I've encountered many tips while googling around today. I've tried to compile them into a logical order of some things to try:
Installing/debugging libxml on mac for ruby/rails.
There's a lot on this page already. But just to point out a few extra things I've gathered from elsewhere.
To me it seems more sensible to try to get a working bundle config command than to bypass this with a gem install command. So use skplunkerin's answer, or...
The following will configure it to use the system libxml headers:
bundle config --global build.libxml-ruby --with-xml2-include=`xcrun --show-sdk-path`/usr/include/libxml2
bundle install
...which worked better for me today. The libxml-ruby gem build was having issues with the latest homebrew installed libxml vs an older system libxml.

therubyracer installation on windows with libv8 installed --with-system-v8

I finally got libv8 installed on my windows with
gem install libv8 -- --with-system-v8
now when I am trying to install therubyracer I get
gem install therubyracer
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Building native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb --with-system-v8
checking for main() in -lpthread... no
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby193/bin/ruby
--with-pthreadlib
--without-pthreadlib
--enable-debug
--disable-debug
--with-v8-dir
--without-v8-dir
--with-v8-include
--without-v8-include=${v8-dir}/include
--with-v8-lib
--without-v8-lib=${v8-dir}/
C:/Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.3/ext/libv8/location.rb:50:in `configure': You hav
e chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError)
and *not* the one that is bundle with the libv8 rubygem. However,
it could not be located. please make sure you have a version of
v8 that is compatible with 3.16.14.3 installed. You may
need to special --with-v8-dir options if it is in a non-standard
location
thanks,
The Mgmt
What I want to know is what this error message really means?
Also I looked this up https://github.com/cowboyd/libv8#bring-your-own-v8
How do I install headers for v8?
When I faced this problem I found that I didn't need those gems in development, because rails use to precompile your assets, so my solution was pretty simple,
Gemfile
gem "rails"
group :production do
gem 'therubyracer'
end
Then when you bundle run this command
$ bundle install --without production
Then smile to the life :D
On Mac you can try updating the v8 library with homebrew:
gem uninstall libv8
brew install v8
gem install therubyracer
Update: Sorry, didn't realize this was a Windows only question.
#Aalap
I ran into the same problem while setting up my Ruby on Rails web application on Windows 7 64-bit. I came across this solution. This is a bit old but solved the problem. This solution provides 'therubyracer' gem file and v8.dll libs to install. The instructions are pretty much clear on the link above.
I installed 'libv8' gem just like Periback's answer on SO and when I tried to install 'therubyracer' gem, it failed with same error as yours. Now my web application is running fine and my "gem list" command shows:
libv8 (3.11.8.13)
therubyracer (0.11.0beta1 x86-mingw32)
Hope this helps.

Error installing debugger-linecache: ERROR: Failed to build gem native extension

I am trying to bundle install but it is showing the above error or debugger..Please find the detailed error from the terminal
Installing debugger-linecache (1.1.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/ruby/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
Makefile creation failed
**************************************************************************
No source for ruby-1.9.2-p0 provided with debugger-ruby_core_source gem.
**************************************************************************
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/ruby/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include
--without-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
Gem files will remain installed in /usr/local/ruby/lib/ruby/gems/1.9.1/gems/debugger-linecache-1.1.1 for inspection.
Results logged to /usr/local/ruby/lib/ruby/gems/1.9.1/gems/debugger-linecache-1.1.1/ext/trace_nums/gem_make.out
An error occured while installing debugger-linecache (1.1.1), and Bundler cannot continue.
Make sure that `gem install debugger-linecache -v '1.1.1'` succeeds before bundling.
If i type ruby-v in the terminal I get
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
If I do gem install debugger-linecache I still get the same error.
How this can be solved. Please help??
I had a very similar error, but on ruby 1.9.3. Running:
gem install debugger-linecache -v '1.1.2' -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p286/
Got it working for me. Credit to this answer.
I solved similiar problem (upgrading Ruby 1.9.3 to 2.0) with simple
bundle update debugger
which as a result installed gem version 1.6.0
Same fix, a bit more up to date
# check ruby version with rvm info
gem install debugger-linecache -v '1.1.2' \
-- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p448
On Ubuntu 13.04 if that matters.
I had to:
gem install debugger-ruby_core_source -v 1.1.2
then:
gem install debugger
Then my bundle completed fine.
Thanks to this comment on the issue.

Problems with jslint-v8 Ruby gem installation on Windows7 64-bit

There is a problem during Rally App SDK 2.0p environment setup on Windows 7 (64-bit). I have installed Ruby 1.8.7-p358 from rubyinstaller.org and managed to install rake Ruby gem. But I have problems installing jslint-v8 gem. It has dependencies on therubyracer and libv8 gems which need to be built using Ruby DevKit. During the installation I got the following error:
C:\ruby> gem install jslint-v8
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing jslint-v8:
ERROR: Failed to build gem native extension.
C:/ruby/bin/ruby.exe extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/ruby/bin/ruby
extconf.rb:13: uninitialized constant Gem (NameError)
Checking for Python...
Gem files will remain installed in C:/ruby/lib/ruby/gems/1.8/gems/libv8-3.3.10.4 for inspection.
Results logged to C:/ruby/lib/ruby/gems/1.8/gems/libv8-3.3.10.4/ext/libv8/gem_make.out
Does anyone know how to install it correctly in Win7?
Thank you!
The gem you try to install depends on libv8 gem, which is nothing more than a wrapper for Google V8 JavaScript VM.
There is no pre-compiled libv8 for Windows (like there is for Linux or OSX), this means it needs to build V8 from scratch.
The code around the build process of V8 is not very portable, not to mention that to compile libv8 you need Python installed :-P
Until today nobody was able to follow the instructions for libv8 pre-compilation on Windows, following the repository instructions:
https://github.com/cowboyd/libv8
Sorry not been able to provide you a better response.
Try this gem install libv8 -v '3.16.14.3' -- --with-system-v8
Reference: Error installing libv8: ERROR: Failed to build gem native extension
For building gem native extensions in Windows when you install a gem, you usually need the DevKit installed too:
http://rubyinstaller.org/downloads/ - go to the devkit download link
Their github page has instructions for installing it: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
I would also recommend using Ruby 1.9.3 instead of 1.8.7, but that shouldn't be much of an issue
Hope that helps.

Resources