安装ruby调试器时出现以下错误
在gemfile中我添加了
gem 'ruby-debug19', :require => 'ruby-debug'
并运行
bundle install
Installing linecache19 (0.5.12) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/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=/usr/local/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
错误的原因是什么
如何安装thre调试器.. ???
答案 0 :(得分:2)
您必须首先在环境变量中设置DevKit的路径
然后运行
gem install linecache19
gem install ruby-debug-base19
gem install ruby-debug-ide
通过命令提示符
愿这项工作
答案 1 :(得分:1)
“在Ubuntu上,本机编译步骤下载ruby 1.9.2源并尝试将其解压缩到当前用户可能没有写入权限的目录中。” - 达伦(参考:http://isitruby19.com/linecache19)
在这种情况下,请尝试sudo bundle install
。
如果问题是它无法解析vm_core.h
文件依赖关系,您可以运行具有特定版本的安装和ruby源的路径:
sudo -E gem install linecache19 -v=0.5.11 -- --with-ruby-include=path_to/ruby-1.9.1-p378/
sudo -E gem install ruby-debug-base19 -v=0.11.23 -- --with-ruby-include=path_to/ruby-1.9.1-p378/
sudo -E gem install ruby-debug-ide -v=0.4.9 -- --with-ruby-include=path_to/ruby-1.9.1-p378/
参考:http://isitruby19.com/linecache19
注意,将path_to/ruby-1.9.1-p378/
替换为安装ruby的路径。
要找出安装ruby的位置,请尝试运行:
which ruby
答案 2 :(得分:1)
来自RVM网站:
如果您在安装ruby-debug19时遇到问题,请尝试使用以下命令进行安装:
$ rvm reinstall 1.9.3 --patch debug --force-autoconf
$ gem install ruby-debug19 -- --with-ruby-include="${MY_RUBY_HOME/rubies/src}"