Error installing debugger-linecache: ERROR: Failed to build gem native extension - ruby-on-rails-3.1

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.

Related

Your Gemfile.lock is corrupt. The following gems are missing from the DEPENDENCIES section:

I am installing one app and I was in this step that I should run bundle install and I get this error
enter code here➜ mavatar git:(master) ✗ bundle install
Fetching gem metadata from http://rubygems.org/
Fetching version metadata from http://rubygems.org/
Fetching dependency metadata from http://rubygems.org/
Using rake 0.9.2
Using multi_json 1.8.2
Using bcrypt-ruby 3.0.1
Using builder 3.0.4
Using i18n 0.6.5
Using erubis 2.7.0
Using rack 1.3.6
Using hike 1.2.1
Using tilt 1.3.3
Installing nokogiri 1.5.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/farbodi/.rvm/gems/ruby-2.3.0-
dev/gems/nokogiri-1.5.0/ext/nokogiri
/home/farbodi/.rvm/rubies/ruby-2.3.0-dev/bin/ruby -r
./siteconf20160806-31805-mdcnrl.rb 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=/home/farbodi/.rvm/rubies/ruby-2.3.0-dev/bin/$(RUBY_BASE_NAME)
extconf.rb:10:in `<main>': uninitialized constant Config (NameError)
Did you mean? RbConfig
CONFIG
extconf failed, exit code 1
Gem files will remain installed in /home/farbodi/.rvm/gems/ruby-
2.3.0-dev/gems/nokogiri-1.5.0 for inspection.
Results logged to /home/farbodi/.rvm/gems/ruby-2.3.0-
dev/extensions/x86_64-linux/2.3.0/nokogiri-1.5.0/gem_make.out
Your Gemfile.lock is corrupt. The following gems are missing from the
DEPENDENCIES section: 'archive-tar-minitar' 'hoe' 'rcov'
So I tried to run this : gem update
gem install hoe
gem install rcov
gem install archive-tar-minitar
gem install nokogiri -v 1.5.0 which gives me ERROR: Failed to build gem native extension. error
I also installed bundle older version, I can pass this step but I get same problem in somewhere else.
I also used rvm and my ruby version is ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux] , And Bundler version 1.12.5
I am new to ruby and gem and bundle I am all confused and I don't know how to start to learn what is going on and how to solve the errors.
You need to install some system packages.
If you are using redhat based, install libxml2 and libxslt and zlib-devel
and if you are using debian based, install zlib1g-dev and liblzma-dev packages

Can't handle 1.9.x error when trying to install linecache with Ruby 2.1.1

I am trying to install linecache with RVM on Ruby 2.1.1.
$ ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
I run bundle install
$ bundle install
It blows saying it isn't compatible with 1.9.x when I run bundle install:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/g/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
Can't handle 1.9.x yet
*** 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=/home/g/.rvm/rubies/ruby-2.1.2/bin/ruby
extconf failed, exit code 1
Gem files will remain installed in /home/g/.rvm/gems/ruby-2.1.2/gems/linecache-0.46
for inspection.
Results logged to /home/g/.rvm/gems/ruby-2.1.2/extensions/x86_64-linux/2.1.0
/linecache-0.46/gem_make.out
An error occurred while installing linecache (0.46), and Bundler cannot continue.
Make sure that `gem install linecache -v '0.46'` succeeds before bundling.
Any ideas whats happening here?
Linecache hasn't been updated in 3 years, the last update was bringing it up to version 1.9.3. Unless you're pulling it from someone else's fork, since you're using 2.1.1 the gem won't work. Most likely the error message hasn't been updated so it just tells you it's invalid for 1.9.x since it doesn't know about any newer versions.

Issue installing therubyracer -v '0.12.1 succeeds before bundling on Windows

I am a Windows 8 user. I installed lib v8 with:
gem install libv8 -v '3.16.14.3' -- --with-system-v8
Now I am facing trouble with installing therubyracer. Following is the error:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby.exe extconf.rb
checking for main() in -lpthread... yes
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}/
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/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}/
/usr/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.3/ext/libv8/location.rb:50:in `configure': You have 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
from /usr/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.3/lib/libv8.rb:7:in `configure_makefile'
from extconf.rb:32:in `<main>'
Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.1/ext/v8/gem_make.out
An error occurred while installing therubyracer (0.12.1), and Bundler cannot
continue.
Make sure that `gem install therubyracer -v '0.12.1'` succeeds before bundling.
I tried following other stackoverflow links but nothing seem to help
Because therubyracer-0.12.1 relys on libv8-3.16.14.7, you install libv8-3.16.14.3 rather than libv8-3.16.14.7 firstly, so there is a conflict.
It works for me:
$ gem uninstall libv8
$ gem install therubyracer -v '0.12.1'
$ gem install libv8 -v '3.16.14.3' -- --with-system-v8

Getting error when installing gem 'frank-cucumber' with ruby 1.9.2

Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Using i18n (0.6.1)
Using multi_json (1.7.2)
Using activesupport (3.2.13)
Using builder (3.2.0)
Using colored (1.2)
Using diff-lcs (1.2.1)
Using json (1.7.7)
Using gherkin (2.11.6)
Using cucumber (1.2.3)
Installing dnssd (2.0) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/ramkishan/.rvm/rubies/ruby-1.9.2-p318/bin/ruby extconf.rb
checking for dns_sd.h... no
unable to find dnssd header
*** 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=/home/ramkishan/.rvm/rubies/ruby-1.9.2-p318/bin/ruby
--with-warnings
--without-warnings
--with-dnssd-dir
--without-dnssd-dir
--with-dnssd-include
--without-dnssd-include=${dnssd-dir}/include
--with-dnssd-lib
--without-dnssd-lib=${dnssd-dir}/lib
Gem files will remain installed in /home/ramkishan/.rvm/gems/ruby-1.9.2-p318#andriod/gems/dnssd-2.0 for inspection.
Results logged to /home/ramkishan/.rvm/gems/ruby-1.9.2-p318#andriod/gems/dnssd-2.0/ext/dnssd/gem_make.out
An error occurred while installing dnssd (2.0), and Bundler cannot continue.
Make sure that `gem install dnssd -v '2.0'` succeeds before bundling.
I have installed gem install dnssd -v '2.0' but problem is remain same. Help me how to resolve it.
The dnssd gem relies on your operating system having a library for dnssd.
Assuming you're not using OS X, which I think has this library built-in, you should install libavahi-compat-libdnssd-dev.
On Ubuntu, it's sudo apt-get install libavahi-compat-libdnssd-dev
I'm guessing you're not on OSX. If you're on Ubuntu, you can run
$> sudo apt-get install libavahi-compat-libdnssd-dev
to install the missing libraries.

Error installing debugger-linecache in Ruby 1.9.3

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

Resources