linecache

URL
http://rubyforge.org/projects/rocky-hacks/linecache
Author(s)
R. Bernstein
Summary
LineCache is a module for reading and caching lines. This may be useful for example in a debugger where the same lines are shown many times.

Add your comment ↓

Comments

linecache (1.9.2) is Working
for godie (Mac OSX, 2 months ago)

thanks i find my answer in comments =)

linecache (1.9.2) is Working
for godie (Mac OSX, 2 months ago)

thanks i find my answer in comments =)

linecache is Working
for Ruslan Kornev (Mac OSX, 11 months ago)

Yes i'ts working for me just replace
ruby-debug
on
ruby-debug19
in my Gemfile

linecache (0.5.12) is Working
for hardipe (GNU/Linux, 11 months ago)

Got it to work after re-installing rvm and ruby 1.9.2-p180

what i did differently was to use bundle install instead of gem install rails (which install bundler as well) and then doing bundle install.

i don't know why it works now, but it does.

linecache (0.5.12) is Failing
for hardipe (GNU/Linux, 11 months ago)

bion@bionicpc:~/dev/depot$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]
bion@bionicpc:~/dev/depot$ gem -v
1.8.5
bion@bionicpc:~/dev/depot$

i can't figure out what's wrong. Doing a fresh install on Ubuntu Natty.

Does anyone know why there is no mkmf.log?
sudo updatedb ; locate mkmf.log | grep linecache reveals nothing

gem install linecache19

Building native extensions. This could take a while...
ERROR: Error installing linecache19:
ERROR: Failed to build gem native extension.

/home/bion/.rvm/rubies/ruby-1.9.2-p180/bin/ruby 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/bion/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
/home/bion/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load
-- openssl (LoadError)
from /home/bion/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/bion/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/https.rb:92:in `<top (required)>'
from /home/bion/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/bion/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/bion/.rvm/gems/ruby-1.9.2-p180@depot-gemset-2/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:11:in `<top
(required)>'
from /home/bion/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/bion/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/bion/.rvm/gems/ruby-1.9.2-p180@depot-gemset-2/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:6:in `<top
(required)>'
from <internal:lib/rubygems/custom_require>:33:in `require'
from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from extconf.rb:2:in `<main>'

Gem files will remain installed in /home/bion/.rvm/gems/ruby-1.9.2-p180@depot-gemset-2/gems/linecache19-0.5.12 for inspection.
Results logged to /home/bion/.rvm/gems/ruby-1.9.2-p180@depot-gemset-2/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out

linecache (0.5.12) is Working
for Stuart Blair (GNU/Linux, about 1 year ago)

Failed the first time I tried it, looked at the mkmf.log file and it seemed that the failures related to the compiler's difficulty in finding vm_core.h. Then saw the comments above hinting that I'd find my missing header file in my ruby installation.

So I tried the following and it worked.

sblair@ubuntu:~/.rvm/src/ruby-1.9.2-p180$ gem install linecache19 -- --with-ruby-include=/home/sblair/.rvm/src/ruby-1.9.2-p180
Building native extensions. This could take a while...
Successfully installed linecache19-0.5.12
1 gem installed
Installing ri documentation for linecache19-0.5.12...
Installing RDoc documentation for linecache19-0.5.12...
sblair@ubuntu:~/.rvm/src/ruby-1.9.2-p180$ date
Thu May 12 14:33:28 PDT 2011
sblair@ubuntu:~/.rvm/src/ruby-1.9.2-p180$
sblair@ubuntu:~/.rvm/src/ruby-1.9.2-p180$ uname -a
Linux ubuntu 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

linecache (0.5.12 release ) is Failing
for Ken Burgett (GNU/Linux, about 1 year ago)

I noticed that the OSX users are getting good results, but I don't see a successful Linux install in the comments. Is it possible that there are OS-related build problems? I am running Ubuntu 10.10.

linecache (1.9.2) is Failing
for Ken Burgett (GNU/Linux, about 1 year ago)

I tried putting ruby-debug19 in the Gemfile, and that did not help. I also tried installing linecache19 with the ruby-headers option, and that also failed. Then I tried the above, but did a gem install of ruby-debug19, and that also failed in the same way. Any other ideas?

linecache (1.9.2) is Working
for Mark Essel (Mac OSX, about 1 year ago)

as per the thread, swap ruby_debug to ruby_debug19

good times ensue.

linecache (0.5.11) is Failing
for Mattias Petter Johansson (Mac OSX, about 1 year ago)

It works BUT will not install via Bundler/rvm. I had to do this:

gem install linecache19 -- --with-ruby-include=/Users/mpj/.rvm/src/ruby-1.9.2-head/

linecache (linecache19 (0.5.11)) is Working
for Kevin Trowbridge (Mac OSX, about 1 year ago)

This using ruby-head (at the time) ruby 1.9.2-p180.

Wasn't working at first. Was failing with the following exception:

-----

Installing linecache (0.43) with native extensions /Users/kmtrowbr/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/Users/kmtrowbr/.rvm/rubies/ruby-1.9.2-head/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=/Users/kmtrowbr/.rvm/rubies/ruby-1.9.2-head/bin/ruby

Gem files will remain installed in /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/linecache-0.43 for inspection.
Results logged to /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/linecache-0.43/ext/gem_make.out
from /Users/kmtrowbr/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:511:in `block in build_extensions'
from /Users/kmtrowbr/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:486:in `each'
from /Users/kmtrowbr/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:486:in `build_extensions'
from /Users/kmtrowbr/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:159:in `install'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.10/lib/bundler/source.rb:96:in `install'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.10/lib/bundler/installer.rb:55:in `block in run'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `block in each'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.10/lib/bundler/installer.rb:44:in `run'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.10/lib/bundler/installer.rb:8:in `install'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.10/lib/bundler/cli.rb:226:in `install'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.10/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.10/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.10/lib/bundler/vendor/thor/base.rb:389:in `start'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.10/bin/bundle:13:in `<top (required)>'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/bin/bundle:19:in `load'
from /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-head/bin/bundle:19:in `<main>'

-----

Turned out my gemfile was messed up. I was requiring ruby-debug19, and then requiring ruby-debug (which is known to not work with 1.9) in addition (something stupid, doh!).

linecache (.43) is Failing
for Alex (Mac OSX, about 1 year ago)

Installing linecache (0.43) with native extensions /Users/eggie5/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/Users/eggie5/.rvm/rubies/ruby-1.9.2-p0/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=/Users/eggie5/.rvm/rubies/ruby-1.9.2-p0/bin/ruby

linecache (19-0.5.11) is Working
for Mike (Mac OSX, about 1 year ago)

1.9.2-p136 + RVM. Worked using ruby-debug19 which installs linecache19 as a dependency:

gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-p136/

linecache (1.9) is Working
for rob (Mac OSX, about 1 year ago)

If you are getting an error, you have require 'ruby-debug' in your Gemfile, not require 'ruby-debug19'

linecache (0.5.11) is Failing
for Richard (GNU/Linux, about 1 year ago)

Ubuntu 10.4. ruby 1.9.2-p0
Gem install works with or without specifying with-ruby-include flag.

However a bundle install always fails as follows:

.
.
.
Using friendly_id (3.1.8)
Using geokit (1.5.0)
Using thor (0.14.6)
Using railties (3.0.3)
Using rails (3.0.3)
Using geokit-rails3 (0.1.2)
Using yui-compressor (0.9.1)
Using jammit (0.5.4)
Using ruby_core_source (0.1.4)
Installing linecache19 (0.5.11) with native extensions /usr/local/lib/site_ruby/1.9.2/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/usr/bin/ruby1.9.2 extconf.rb
checking for vm_core.h... no
Makefile creation failed

This is a catastrophic failure which is preventing provisioning of Rails 3.

linecache (0.43) is Failing
for a5his (Mac OSX, about 1 year ago)

Building native extensions. This could take a while...
ERROR: Error installing linecache:
ERROR: Failed to build gem native extension.

/Users/me/.rvm/rubies/ruby-1.9.2-head/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=/Users/me/.rvm/rubies/ruby-1.9.2-head/bin/ruby

Gem files will remain installed in /Users/me/.rvm/gems/ruby-1.9.2-head@fmn/gems/linecache-0.43 for inspection.
Results logged to /Users/me/.rvm/gems/ruby-1.9.2-head@fmn/gems/linecache-0.43/ext/gem_make.out

linecache (1.9) is Working
for Allan (GNU/Linux, about 1 year ago)

For those struggling with ubuntu (10.10 for me) and rvm use:
gem install linecache19 -- --with-ruby-include=/home/username/.rvm/rubies/ruby-1.9.2-p0

linecache (0.5.11)) is Working
for Erik Pukinskis (Mac OSX, about 1 year ago)

I'm using ruby 1.9.2 with RVM, and in my bundle I just have gem "ruby-debug19" in my gemfile. Bundler 1.0.0. Bundler installs linecache19 just fine, with a ruby_core_source dependency without my having to do anything fancy.

linecache is Working
for skif (Mac OSX, about 1 year ago)

Greetings.

I've got an error while installing linecache19

# gem install linecache19 -- --with-ruby-include=/Users/skif/.rvm/src/ruby-1.9.2-p0/
Building native extensions. This could take a while...
ERROR: Error installing linecache19:
ERROR: Failed to build gem native extension.

/Users/skif/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb --with-ruby-include=/Users/skif/.rvm/src/ruby-1.9.2-p0/
*** 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=/Users/skif/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- ruby_core_source (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from extconf.rb:2:in `<main>'

Gem files will remain installed in /Users/skif/.rvm/gems/ruby-1.9.2-p0@rails2/gems/linecache19-0.5.11 for inspection.
Results logged to /Users/skif/.rvm/gems/ruby-1.9.2-p0@rails2/gems/linecache19-0.5.11/ext/trace_nums/gem_make.out

linecache (0.5.11) is Working
for Francis (Mac OSX, about 1 year ago)

Ruby installed with RVM, must give ruby headers location:

gem install linecache19 -- --with-ruby-include=/Users/francis/.rvm/src/ruby-1.9.2-preview3/

linecache (0.5.11) is Working
for Ronie Uliana (GNU/Linux, about 1 year ago)

I found the fix: "RTFM" =/

Since I'm using RVM, I have to provide the following option to gem install:

--with-ruby-include=/home/user/.rvm/src/ruby-1.9.1-p378

As stated in:

http://wiki.github.com/mark-moseley/ruby-debug/installation-command-line-version

bad Ronie... bad Ronie...

linecache (0.5.11) is Failing
for Ronie Uliana (GNU/Linux, about 1 year ago)

When I try:

gem install linecache19

After a while it throws:
(My net is working ok, btw)

Building native extensions. This could take a while...
ERROR: Error installing linecache19:
ERROR: Failed to build gem native extension.

/home/user/.rvm/rubies/ruby-1.9.1-p378/bin/ruby extconf.rb
checking for vm_core.h... no
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-1.9.1-p378/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
/home/user/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/net/http.rb:581:in `initialize': Connection timed out - connect(2) (Errno::ETIMEDOUT)
from /home/user/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/net/http.rb:581:in `open'
from /home/user/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/net/http.rb:581:in `block in connect'
from /home/user/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/timeout.rb:44:in `timeout'
from /home/user/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/timeout.rb:82:in `timeout'
from /home/user/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/net/http.rb:581:in `connect'
from /home/user/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/net/http.rb:574:in `do_start'
from /home/user/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/net/http.rb:563:in `start'
from /home/user/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/net/http.rb:1094:in `request'
from /home/user/.rvm/gems/ruby-1.9.1-p378/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:239:in `block in read'
from /home/user/.rvm/gems/ruby-1.9.1-p378/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:286:in `connect'
from /home/user/.rvm/gems/ruby-1.9.1-p378/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:234:in `read'
from /home/user/.rvm/gems/ruby-1.9.1-p378/gems/ruby_core_source-0.1.4/lib/contrib/uri_ext.rb:128:in `download'
from /home/user/.rvm/gems/ruby-1.9.1-p378/gems/ruby_core_source-0.1.4/lib/ruby_core_source.rb:55:in `block in create_makefile_with_core'
from /home/user/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/tempfile.rb:199:in `open'
from /home/user/.rvm/gems/ruby-1.9.1-p378/gems/ruby_core_source-0.1.4/lib/ruby_core_source.rb:51:in `create_makefile_with_core'
from extconf.rb:20:in `<main>'
Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p378.tar.gz

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

linecache (0.5.11) is Failing
for Blaine (Mac OSX, about 1 year ago)

Use ruby-debug19 and linecache19 gems instead of the original.

There's some comments below with more info if necessary.

linecache (0.43) is Failing
for snl (Mac OSX, over 2 years ago)

Use linecache19. If you were installing this as a dependency of ruby-debug, install ruby-debug19 instead.

For best of both worlds, do gem RUBY_VERSION.include?('1.9') ? 'ruby-debug19' : 'ruby-debug' in your Gemfile.

linecache (0.4.3) is Failing
for andy (GNU/Linux, over 2 years ago)

wc04:~# gem install linecache
Building native extensions. This could take a while...
ERROR: Error installing linecache:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9 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=/usr/bin/ruby1.9

Gem files will remain installed in /usr/lib/ruby1.9/gems/1.9.0/gems/linecache-0.43 for inspection.
Results logged to /usr/lib/ruby1.9/gems/1.9.0/gems/linecache-0.43/ext/gem_make.out

linecache (0.43) is Failing
for Paul Hepworth (Mac OSX, over 2 years ago)

Mark, thanks for the hard work on this. I read from your blog that you had created a new gem named linecache19 because you wanted to keep the original in place. Although linecache still doesn't work, the work around that I found was to install ruby-debug19 instead of the original ruby-debug.

linecache is Working
for Mark Moseley (Windows, over 2 years ago)

I've been working on the port. Should be done this week.

linecache (0.43) is Failing
for Pistos (GNU/Linux, over 2 years ago)

Pretty much the same results for me as Ondrej got.

linecache (0.43) is Failing
for Ondřej Konečný (GNU/Linux, over 3 years ago)

It doesn't even install.

$ gem install linecache
Building native extensions. This could take a while...
ERROR: Error installing linecache:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb install linecache
Can't handle 1.9.x yet

Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/linecache-0.43 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/linecache-0.43/ext/gem_make.out

Add your comment




Yes No