2

在相应目录中运行“捆绑安装”时,出现以下错误:

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.

在尝试运行gem install linecache19 -v '0.5.12'(如前所述)时,我收到以下错误:

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

然后我尝试了“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 有:

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 */

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

我现在被困住了。接下来我该怎么做。

4

2 回答 2

11

linecache19 是 ruby​​-debug 的一部分,不再受支持,需要手动处理。在您的 Gemfile 中,将 ruby​​-debug-base19 和 ruby​​-debug19 替换为 "gem 'debugger'" 这应该可以解决问题。在此处阅读有关此内容的更多信息 - https://github.com/cldwalker/debugger

于 2013-11-18T21:14:40.857 回答
6

对于那些使用 Ruby >= 2.xx的用户,请尝试使用 'byebug',因为 'debugger' 仅适用于 ruby​​ 1.9.2 和 1.9.3。

gem install 'byebug'

于 2015-01-26T17:32:55.553 回答