2

On running "bundle install" in the corresponding directory I got hte following error:

An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.

On trying to run gem install linecache19 -v '0.5.12'(as mentioned), I'm getting the following error:

nishant@nishant-Inspiron-1545:~/voylla_website$ gem install linecache19 -v '0.5.12'
Building native extensions.  This could take a while...
ERROR:  Error installing linecache19:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.9.1 extconf.rb
checking for vm_core.h... no
/home/nishant/.rvm/gems/ruby-1.9.2-p320/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:39: Use RbConfig instead of obsolete and deprecated Config.
checking for vm_core.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=/usr/bin/ruby1.9.1
--with-ruby-dir
--without-ruby-dir
--with-ruby-include
--without-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
/usr/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': Permission denied - /usr/include/ruby-1.9.1/ruby-1.9.3-p194 (Errno::EACCES)
from /usr/lib/ruby/1.9.1/fileutils.rb:247:in `fu_mkdir'
from /usr/lib/ruby/1.9.1/fileutils.rb:221:in `block (2 levels) in mkdir_p'
from /usr/lib/ruby/1.9.1/fileutils.rb:219:in `reverse_each'
from /usr/lib/ruby/1.9.1/fileutils.rb:219:in `block in mkdir_p'
from /usr/lib/ruby/1.9.1/fileutils.rb:205:in `each'
from /usr/lib/ruby/1.9.1/fileutils.rb:205:in `mkdir_p'
from /home/nishant/.rvm/gems/ruby-1.9.2-p320/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:59:in `block in create_makefile_with_core'
from /usr/lib/ruby/1.9.1/tempfile.rb:320:in `open'
from /home/nishant/.rvm/gems/ruby-1.9.2-p320/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:51:in `create_makefile_with_core'
from extconf.rb:19:in `<main>'
Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz


Gem files will remain installed in /home/nishant/.rvm/gems/ruby-1.9.2-p320/gems/linecache19-0.5.12 for inspection.
Results logged to /home/nishant/.rvm/gems/ruby-1.9.2-p320/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out

I then tried "sudo gem install linecache19 -v '0.5.12"

nishant@nishant-Inspiron-1545:~/voylla_website$ sudo gem install linecache19 -v '0.5.12'
[sudo] password for nishant: 
Fetching: archive-tar-minitar-0.5.2.gem (100%)
Fetching: ruby_core_source-0.1.5.gem (100%)
Fetching: linecache19-0.5.12.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing linecache19:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.9.1 extconf.rb
checking for vm_core.h... *** 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/bin/ruby1.9.1
--with-ruby-dir
--without-ruby-dir
--with-ruby-include
--without-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
/usr/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /usr/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
from /usr/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /usr/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /usr/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /usr/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /usr/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /usr/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /usr/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /usr/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
from extconf.rb:15:in `block in <main>'
from /var/lib/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in `call'
from /var/lib/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in `create_makefile_with_core'
from extconf.rb:19:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/linecache19-0.5.12 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out

mkmf.log has:

have_header: checking for vm_core.h... -------------------- no

"gcc -o conftest -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -D_FORTIFY_SOURCE=2 -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -fno-strict-aliasing -fPIC conftest.c  -L. -L/usr/lib -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -rdynamic -Wl,-export-dynamic     -lruby-1.9.1  -lpthread -lrt -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main() {return 0;}
/* end */

"gcc -E -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -D_FORTIFY_SOURCE=2 -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -fno-strict-aliasing -fPIC  conftest.c -o conftest.i"
conftest.c:3:21: fatal error: vm_core.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <vm_core.h>
/* end */

--------------------

have_header: checking for vm_core.h... -------------------- no

"gcc -E -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -I/usr/include/ruby-1.9.1/ruby-1.9.3-p194 -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -fno-strict-aliasing -fPIC  conftest.c -o conftest.i"
conftest.c:3:21: fatal error: vm_core.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <vm_core.h>
/* end */

--------------------

And I'm stuck now. What should I do next.

nish
  • 6,952
  • 18
  • 74
  • 128
  • 1
    The output of the first gem command lists `/usr/bin/ruby1.9.1 extconf.rb`, while two lines later it looks like you're using ruby 1.9.2 installed by rvm. Maybe make sure that the version of ruby you're using is the rvm one instead of the system installed one? – Andy Sep 19 '13 at 16:39
  • @Andy : How do I do that? Would "rvm use ruby-1.9.2-p320" suffice? – nish Sep 19 '13 at 16:47
  • `rvm use ruby-1.9.2` should be enough. You can use `ruby use ruby-1.9.2 --default` to make ruby 1.9.2 the default that is used whenever you start a new shell. If that doesn't work, run `which ruby` and `ruby --version` to see which ruby is getting called. – Andy Sep 19 '13 at 17:49
  • @Andy : I ran "rvm use ruby-1.9.2-p320" before "bundle install". but still i'm getting the same thing. "which ruby" and "ruby --version" both are showing "ruby 1.9.2p320" – nish Sep 19 '13 at 17:53
  • Maybe check that answer: http://stackoverflow.com/a/7382840/2291093 as it seems similar to your issue. – zrl3dx Sep 19 '13 at 18:21

2 Answers2

11

linecache19 is part of ruby-debug which is no longer supported and requires manual handling. In your Gemfile, replace ruby-debug-base19 and ruby-debug19 with "gem 'debugger'" This should solve the problem. Read more about this here - https://github.com/cldwalker/debugger

Michaerr
  • 241
  • 3
  • 12
6

For those using Ruby >= 2.x.x, try 'byebug', because 'debugger' is only available for ruby 1.9.2 and 1.9.3.

gem install 'byebug'

Community
  • 1
  • 1
Chris
  • 380
  • 5
  • 10