Error trying to run a ruby program on Ubuntu 14.04 - ruby-debug-base19 not installed

I have KomdoIDE installed in my home directory tree.
I tried to run a ruby hello world program and got this error:

Error: cannot load such file -- /home/user/Programs/Komodo-IDE-8/lib/support/dbgp/rubylib/1.9/../lib/trace_nums19
    /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    /home/user/Programs/Komodo-IDE-8/lib/support/dbgp/rubylib/1.9/tracelines19.rb:16:in `rescue in rescue in <module:TraceLineNumbers>'
    /home/user/Programs/Komodo-IDE-8/lib/support/dbgp/rubylib/1.9/tracelines19.rb:12:in `rescue in <module:TraceLineNumbers>'
    /home/user/Programs/Komodo-IDE-8/lib/support/dbgp/rubylib/1.9/tracelines19.rb:7:in `<module:TraceLineNumbers>'
    /home/user/Programs/Komodo-IDE-8/lib/support/dbgp/rubylib/1.9/tracelines19.rb:6:in `<top (required)>'
    /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    /home/user/Programs/Komodo-IDE-8/lib/support/dbgp/rubylib/1.9/linecache19.rb:69:in `<top (required)>'
    /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    /home/user/Programs/Komodo-IDE-8/lib/support/dbgp/rubylib/1.9/ruby-debug-base.rb:3:in `<top (required)>'
    /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    /home/user/Programs/Komodo-IDE-8/lib/support/dbgp/rubylib/rdbgp/loader.rb:21:in `<top (required)>'
    /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    /home/user/Programs/Komodo-IDE-8/lib/support/dbgp/rubylib/rdbgp.rb:99:in `get_going'
    /home/user/Programs/Komodo-IDE-8/lib/support/dbgp/rubylib/rdbgp.rb:113:in `<top (required)>'
    /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
The Komodo ruby debugger couldn't load the ruby-debug-base component.
  This library ships with Komodo, but also can be installed by running    'gem install ruby-debug-base19'

If I do sudo gem install ruby-debug-base19 I get

[sudo] password for user: 
Fetching: columnize-0.9.0.gem (100%)
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 ruby-debug-base19:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from extconf.rb:1: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

If I do Tools->Run Command gem install ruby-debug-base19 I get

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions into the /var/lib/gems/1.9.1 directory.

If I do Tools->Run Command sudo gem install ruby-debug-base19 I get

sudo: no tty present and no askpass program specified

There are no reasons to use Tools - Run Command for installing gem packages.

Could you please run through the steps in our Ruby Debugging documentation to see if that resolves your problem? In particular the Troubleshooting section suggests that you use rvm to set your Ruby environment.

Thanks for the replies.

I looked at the Ruby Debugging documentation page, but was not able to see anything that was a fix.

I googled and found out the gem error I was getting was talked about here. The fix was to install the ruby-dev package for Ubuntu. After that I was able to successfully run the command that KomodoIDE was telling me to do:
“gem install ruby-debug-base19”

However, the error remained the same. With the same two lines at the end:

The Komodo ruby debugger couldn’t load the ruby-debug-base component.
This library ships with Komodo, but also can be installed by running `gem install ruby-debug-base19’

It would seem that there is a possibility of bug report here, as it says it can’t find something that it claims to ship with and/or it will find it after the given command is run (and it doesn’t).

Hi @komodingo,

This Komodo Ruby Debugging FAQ from our old site should get you all fixed up.

The original bug is here.

  • Carey

Yes, that fixed it. Thanks!