你能帮我解决组织任何Ruby for Ruby的问题,以便我可以调试我的脚本。
我选择了Eclipse + Aptana插件。但这不是教条。如果有一种更简单的方法,我肯定会更改IDE和插件或任何东西。
好吧,让我们回到现在的状态。 我似乎无法在普通用户下安装ruby-debug-ide。 在root用户下,我可以执行gem install ruby-debug-ide。我可以在gem list --local中看到ruby-debug-ide。 但仅限以root用户身份登录。 下面的任何消息都指普通用户。
我现在拥有的内容:
在Eclipse中我尝试将我的应用程序调试为ruby应用程序,我明白了:
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:315:in 来自
to_specs': Could not find 'ruby-debug-ide' (>= 0) among 23 total gem(s) (Gem::LoadError) Checked in 'GEM_PATH=/home/michael/.rvm/gems/ruby-2.2.3:/home/michael/.rvm/gems/ruby-2.2.3@global', execute
gem envfor more information from /home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:324:in
to_spec' /home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:ingem' from /usr/local/bin/rdebug-ide:22:in
“
当我运行gem env:
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.8
- RUBY VERSION: 2.2.3 (2015-08-18 patchlevel 173) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/michael/.rvm/gems/ruby-2.2.3
- RUBY EXECUTABLE: /home/michael/.rvm/rubies/ruby-2.2.3/bin/ruby
- EXECUTABLE DIRECTORY: /home/michael/.rvm/gems/ruby-2.2.3/bin
- SPEC CACHE DIRECTORY: /home/michael/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/michael/.rvm/gems/ruby-2.2.3
- /home/michael/.rvm/gems/ruby-2.2.3@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/michael/.rvm/gems/ruby-2.2.3/bin
- /home/michael/.rvm/gems/ruby-2.2.3@global/bin
- /home/michael/.rvm/rubies/ruby-2.2.3/bin
- /home/michael/.rvm/gems/ruby-2.2.3/bin
- /home/michael/.rvm/gems/ruby-2.2.3@global/bin
- /home/michael/.rvm/rubies/ruby-2.2.3/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /usr/local/games
- /usr/share/rvm/bin
- /home/michael/.rvm/bin
- /home/michael/.rvm/bin
- /home/michael/.rvm/bin
然后我尝试gem list --local:
*** LOCAL GEMS ***
activesupport (4.2.4)
archive-tar-minitar (0.5.2)
bigdecimal (1.2.6)
bundler-unload (1.0.2)
columnize (0.9.0)
debase-ruby_core_source (0.8.0)
executable-hooks (1.3.2)
gem-wrappers (1.2.7)
i18n (0.7.0)
io-console (0.4.3)
json (1.8.1)
mini_portile (0.6.2)
minitest (5.8.2)
psych (2.0.8)
rails-deprecated_sanitizer (1.0.3)
rake (10.4.2)
rdoc (4.2.0)
ruby_core_source (0.1.5)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
sudo (0.1.1)
thread_safe (0.3.5)
tzinfo (1.2.2)
我尝试使用gem install ruby-debug-ide并获取此信息:
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug-ide:
ERROR: Failed to build gem native extension.
/home/michael/.rvm/rubies/ruby-2.2.3/bin/ruby mkrf_conf.rb
Installing base gem
Building native extensions. This could take a while...
Building native extensions. This could take a while...
ERROR: Failed to build gem native extension.
/home/michael/.rvm/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20151104-6046-7cu247.rb 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=/home/michael/.rvm/rubies/ruby-2.2.3/bin/$(RUBY_BASE_NAME)
--with-ruby-dir
--without-ruby-dir
--with-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb:587:in `try_cpp'
from /home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb:1060:in `block in have_header'
from /home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
from /home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from /home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
from /home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from /home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
from /home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
from /home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/mkmf.rb:1059:in `have_header'
from extconf.rb:31:in `block in <main>'
from /home/michael/.rvm/gems/ruby-2.2.3/gems/debase-ruby_core_source-0.8.0/lib/debase/ruby_core_source.rb:18:in `call'
from /home/michael/.rvm/gems/ruby-2.2.3/gems/debase-ruby_core_source-0.8.0/lib/debase/ruby_core_source.rb:18:in `create_makefile_with_core'
from extconf.rb:47:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /home/michael/.rvm/gems/ruby-2.2.3/gems/debase-0.2.2.beta6 for inspection.
Results logged to /home/michael/.rvm/gems/ruby-2.2.3/extensions/x86_64-linux/2.2.0/debase-0.2.2.beta6/gem_make.out
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:89:in `run'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/ext/ext_conf_builder.rb:36:in `block in build'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/tempfile.rb:319:in `open'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/ext/ext_conf_builder.rb:19:in `build'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:160:in `chdir'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:160:in `block in build_extension'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:159:in `synchronize'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:159:in `build_extension'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:195:in `each'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:195:in `build_extensions'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/installer.rb:702:in `build_extensions'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/installer.rb:250:in `install'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/request_set.rb:166:in `block in install'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/request_set.rb:150:in `each'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/request_set.rb:150:in `install'
/home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/dependency_installer.rb:404:in `install'
mkrf_conf.rb:35:in `rescue in <main>'
mkrf_conf.rb:28:in `<main>'
rake failed, exit code 1
Gem files will remain installed in /home/michael/.rvm/gems/ruby-2.2.3/gems/ruby-debug-ide-0.6.0 for inspection.
Results logged to /home/michael/.rvm/gems/ruby-2.2.3/extensions/x86_64-linux/2.2.0/ruby-debug-ide-0.6.0/gem_make.out
答案 0 :(得分:-1)
我设法用以下代码自己解决问题:
main.config