1

I am frustrated because I have tried other StackOverflow articles on this issue, but have been unsuccessful in fixing my own error. When I call

'gem install linecache19'

...the following error is outputed

ERROR:  Error installing linecache19:
    ERROR: Failed to build gem native extension.

    /home/user/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for vm_core.h... no
/home/user/.rvm/gems/ruby-2.0.0-p247/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:39:in `create_makefile_with_core': Use RbConfig instead of obsolete and deprecated Config.
/home/user/.rvm/gems/ruby-2.0.0-p247/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:39:in `create_makefile_with_core': 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=/home/user/.rvm/rubies/ruby-2.0.0-p247/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}/
/home/user/.rvm/gems/ruby-2.0.0-p247/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:268:in `block (2 levels) in read': Looking for http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-2.0.0-p247.tar.gz and all I got was a 404! (URI::NotFoundError)
    from /home/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1413:in `block (2 levels) in transport_request'
    from /home/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http/response.rb:162:in `reading_body'
    from /home/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1412:in `block in transport_request'
    from /home/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1403:in `catch'
    from /home/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1403:in `transport_request'
    from /home/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1376:in `request'
    from /home/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1369:in `block in request'
    from /home/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:852:in `start'
    from /home/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1367:in `request'
    from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:239:in `block in read'
    from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:286:in `connect'
    from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:234:in `read'
    from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:128:in `download'
    from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:55:in `block in create_makefile_with_core'
    from /home/user/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tempfile.rb:324:in `open'
    from /home/user/.rvm/gems/ruby-2.0.0-p247/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-2.0.0-p247.tar.gz


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

Please notice the culprit line...

/home/user/.rvm/gems/ruby-2.0.0-p247/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:268:in `block (2 levels) in read': Looking for http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-2.0.0-p247.tar.gz and all I got was a 404! (URI::NotFoundError)

Obviously this does not work...the url http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-2.0.0-p247.tar.gz doesn't make sense. (Accesses Ruby1.9 then looks for the Ruby2.0 tar.gz)

This is for a class project (for CS169: Software Engineering at UC Berkeley) that requires the gem 'ruby-debug19', which tries to install 'linecache19'.

Do I have to downgrade to ruby1.9, or can I keep using ruby2.0?

When I call

$ruby -v

I get the following...

ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]

I am using RVM.

I am slightly suspicious that linecache19 does not support ruby 2.0.

bjliu
  • 192
  • 1
  • 2
  • 14
  • Could be that the selected version of debugger does not support your current Ruby version, update debugger gem: `bundle update debugger`. – rmagnum2002 Oct 15 '13 at 07:56

5 Answers5

3

Try installing byebug instead of debugger for Ruby 2.0. You already seem to have the minimum supportable patchlevel of Ruby.

HargrimmTheBleak
  • 2,147
  • 1
  • 19
  • 19
  • 2 questions: 1) Is ruby-debug19 the same thing as debugger? 2) If so, would changing to byebug damage my already existing code? – bjliu Oct 15 '13 at 21:05
  • 1) debugger is a newer port of ruby-debug19. https://github.com/cldwalker/debugger has a "What's different from ruby-debug19" section. 2) Absolutely not, you'll just have to use `byebug` where you'd have used `debugger` – HargrimmTheBleak Oct 16 '13 at 02:36
2

debugger and linecache are not supported by Ruby 2.0. You can use byebug gem instead.

0

Try doing this:

gem install linecache19 -- --with-ruby-include=$rvm_path/src/ruby-2.0.0-p247

berislavbabic
  • 459
  • 5
  • 9
  • 1
    Try using debugger gem then, instead of ruby-debug19, the api calls are the same, and i think debugger is better supported. I just now realized you are trying to use ruby-debug19. I never did manage to get it to work on 1.9+ `gem install debugger -- --with-ruby-include=$rvm_path/src/ruby-2.0.0-p247` – berislavbabic Oct 15 '13 at 07:48
  • Thanks! I think that is the culprit...19 seems to stand for Ruby1.9, I have updated to question to reflect this--the problem now becomes finding an alternative to ruby-debug19, which does not work on Ruby2.0. – bjliu Oct 15 '13 at 20:51
0

Add this in your gem file

   gem 'debugger'

and give

   bundle install
Jenorish
  • 1,694
  • 14
  • 19
0

you just need to replace the code in url

/home/{your-user-name]/.rvm/gems/ruby-2.0.0-p645/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb

from 1.9 to 2.0

Mohamed Sami
  • 866
  • 10
  • 22