无法完成“捆绑安装” - 无法安装linecache19 -v'0.5.12'

时间:2013-09-19 16:10:32

标签: ruby-on-rails ruby gem bundler linecache

在相应目录中运行“bundle install”后,我得到了以下错误:

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

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

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

2 个答案:

答案 0 :(得分:11)

linecache19是ruby-debug的一部分,不再支持它,需要手动处理。 在您的Gemfile中,将ruby-debug-base19和ruby-debug19替换为“gem'debugger'” 这应该可以解决问题。 在此处详细了解此信息 - https://github.com/cldwalker/debugger

答案 1 :(得分:6)

对于使用Ruby&gt; = 2.x.x 的人,请尝试使用&#39; byebug&#39;,因为&#39; debugger&#39;仅适用于ruby 1.9.2和1.9.3。

gem install 'byebug'