Eclipse + Apatna 插件:无法调试

Eclipse + Apatna plug-in: unable to debug

你能帮我解决为 Ruby 组织任何 IDE 的问题,以便我可以调试我的脚本。

我选择了Eclipse+Aptana插件。但这不是教条。如果有更简单的方法,我肯定会更改 IDE 和插件或任何东西。

好吧,让我们 return 了解我现在所拥有的。 我的普通用户下好像安装不了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', executegem 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' from /home/michael/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in gem' 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 安装 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

我用下面的代码自己解决了这个问题:

sudo apt-get install libgmp-dev