Trouble with gem installations - ruby

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.

Related

Not able to install Jekyll because of therubyracer error on mac

I am trying to run Jekyll and I have the following contents in the Gemfile
source "https://rubygems.org"
gem 'jekyll-auth'
gem 'redcarpet'
gem 'jekyll-lunr-js-search'
gem 'rouge'
gem 'jekyll-sitemap'
I am running bundle install for installing the dependencies specified. Everything works fine until it tries to install a gem called therubyracer. Then the process is stopped by throwing the following error:
Installing nokogiri 1.11.3 (x86_64-darwin)
Fetching libv8 3.16.14.19
Installing libv8 3.16.14.19 with native extensions
Fetching ref 2.0.0
Installing ref 2.0.0
Fetching therubyracer 0.12.3
Installing therubyracer 0.12.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/therubyracer-0.12.3/ext/v8
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r
./siteconf20210430-34242-1i9kf2u.rb extconf.rb --with-v8-dir\=/usr/local/opt/v8#3.15
checking for -lpthread... yes
checking for -lobjc... 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}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
--with-pthreadlib
--without-pthreadlib
--with-objclib
--without-objclib
--enable-debug
--disable-debug
--with-v8-dir
--with-v8-include
--without-v8-include=${v8-dir}/include
--with-v8-lib
--without-v8-lib=${v8-dir}/lib
/Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using
--with-system-v8, you have chosen to use the version (Libv8::Location::System::NotFoundError)
of V8 found on your system and *not* the one that is bundled with
the libv8 rubygem.
However, your system version of v8 could not be located.
Please make sure your system version of v8 that is compatible
with 3.16.14.19 installed. You may need to use the
--with-v8-dir option if it is installed in a non-standard location
from /Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.19/lib/libv8.rb:7:in `configure_makefile'
from extconf.rb:32:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/therubyracer-0.12.3/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/therubyracer-0.12.3 for inspection.
Results logged to
/Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/therubyracer-0.12.3/gem_make.out
An error occurred while installing therubyracer (0.12.3), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.12.3' --source 'https://rubygems.org/'` succeeds
before bundling.
In Gemfile:
jekyll-lunr-js-search was resolved to 3.3.0, which depends on
therubyracer
Now for fixing this error, I have tried the following commands as specified in some of the posts
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
But this is again giving the same error. I have tried
bundle config build.libv8 --with-system-v8
bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8#3.15)
But there is no luck. I tried by specifying the brew based path for v8, in the command as follows:
sudo gem install therubyracer -- --with-v8-dir= /usr/local/Cellar/v8#3.15
Even after doing all these, I am stuck with the same error which says our system version of v8 could not be located.
I am trying this on a Mac machine with BigSur 11.2.3 is installed and the Ruby version is ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20] and gem is of version 3.0.3.
It will be of great help if someone can tell me how this error can be fixed and I can install and run Jekyll successfully.
I encountered same problem two years ago. I found that libv8 3.16.14.19 is not compatible with therubyracer 0.12.3 and wrote a post to record my solution.
Try the following steps:
Clean up your system
gem uninstall -a libv8
gem uninstall -a therubyracer
Install libv8 with specific version before installing therubyracer
gem install libv8 -v '3.16.14.15'
Install therubyracer
gem install therubyracer -v '0.12.3'
Update libv8 to the version specified in your gemfile
bundle
There may still have problem in macOS BigSur 11.2.
If it raises fatal error: 'climits' file not found in Step 2, try this:
gem install libv8 -v '3.16.14.15' -- --with-system-v8
If it raises errors in Step 3, try this:
brew install v8-315
gem install therubyracer -v '0.12.3' -- --with-v8-dir=/usr/local/opt/v8#3.15

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.

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

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