Debugging problem in RubyMine 6.3

Hi,

I tried debugging a RoR app with RubyMine 6.3 on Mac OS X (Mavericks) with Ruby 2.0.0.

Unfortunately, when I start my debugging environment, I get this error message from RubyMine:

Error running Development: Ballyhoo
            Failed to Install Gems. Following gems were not installed:
            /Applications/RubyMine.app/rb/gems/debase-0.0.9.gem:  While executing gem ... (Errno::EACCES)
            Permission denied - /Users/lpcarignan/.gem/ruby/2.0.0/extensions/universal-darwin-13 Building native extensions.  This could take a while...

As RubyMine couldn't install debase, I tried to install it manually in /Applications/RubyMine/rb/gems. It installed without any problems.

Then, when I run the debugger again, I get this error message:

usr/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/lpcarignan/.gem/ruby/2.0.0/gems/ruby-debug-ide-0.4.23.beta1/bin/rdebug-ide --disable-int-handler --port 56037 --dispatcher-port 56038 -- /Users/lpcarignan/RubymineProjects/Ballyhoo/bin/rails server -b 0.0.0.0 -p 3000 -e development
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- debase_internals (LoadError)
 from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 from /Users/lpcarignan/.gem/ruby/2.0.0/gems/debase-0.0.9/lib/debase.rb:4:in `<top (required)>'
 from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 from /Users/lpcarignan/.gem/ruby/2.0.0/gems/ruby-debug-ide-0.4.23.beta1/lib/ruby-debug-ide.rb:8:in `<top (required)>'
 from /Users/lpcarignan/.gem/ruby/2.0.0/gems/ruby-debug-ide-0.4.23.beta1/bin/rdebug-ide:8:in `require_relative'
 from /Users/lpcarignan/.gem/ruby/2.0.0/gems/ruby-debug-ide-0.4.23.beta1/bin/rdebug-ide:8:in `<top (required)>'
 from -e:1:in `load'
 from -e:1:in `<main>'

Would somebody have an idea on what I should do to fix this?

Debugger problems seem to be a recurring theme with RubyMine:



Thanks,

Louis-Philippe
4 comments

Hi Louis-Philippe,

My personal experience would suggest to stay away from using the Apple system provided ruby. You can't stay up to date, and you will bump either into problems when building gems with native extensions (who needs Universal Binaries anymore?), or some permission issues on the file system forcing you to use sudo.

You have the choice of using RVM (if you need to develop serveral projects with different ruby versions), or installing ruby via Homebrew (that's what I do, as I use only ruby 2.1.1 both in dev and in prod).

Using my 'brewed' ruby 2.1.1, I can use the Rubymine 6.3 debugger without any problem.

Cheers,
Fred.

0

Hi Fred,

Thanks for the answer. It helped me a lot to move forward. I still have one small problem that you may know how to solve.

I followed this post on stackoverflow which is quite similar to your advice.

http://stackoverflow.com/questions/12287882/installing-ruby-with-homebrew

I ran brew to install ruby (brew install ruby). It put the whole thing in /usr/local/Cellar/ruby/2.1.1_1.

I updated my .bash_profile to include this path at the beginning of the PATH env. variable.

I also updated /etc/paths as prescribed in the post above just to make sure this was also covered.

I rebooted my computer.

In RubyMine, I went into Preferences->Ruby SDK and Gems where I removed the old Ruby SDK and added the one downloaded by brew.

RubyMine than offered me the choice of downloading bundle and run it on the gemfile of my project. It downloaded bundle and the gems required by my Rails application. But it seems like they were downloaded somewhere else than with Ruby 2.1.1_1.

This is where my new problem appeared. It seems like RubyMine is still using old paths when downloading bundle and its gems.

I've attached a screenshot of the "Ruby SDK and Gems" pane in RubyMine. As you can see, only bundle exists with Ruby 2.1.1_1. Would you have an idea how come the rest of the gems won't install under SDK 2.1.1_1?

I decided to start a new Rails project in RubyMine to see how this would go. I got the error message "Unable to run gem 'rails'. Cannot find 'rails'".

If you have any idea on how to solve this problem, let me know.

Cheers,

Louis-Philippe



Attachment(s):
RubySDKPane.png
NewProjectError.png
0

Hi Louis-Philippe,

Before digging into your rails problem, I think something went wrong during your ruby 2.1.1 installation: have a look at my screenshot, the folder is named 2.1.1 not 2.1.1_1...

You should try a:

%brew remove ruby

... check your /usr/local/Cellar doesn't have any ruby folder, then:

%brew install ruby

Fred.



Attachment(s):
ruby_folder.png
0

Hi Fred,

Thanks for looking into my problem. I tried what you said and I wanted to let you know. I've attached a screenshot (Terminal.png) of the commands I did.

I did a which ruby command to see which ruby I had installed. It did say ruby 2.1.1_1. Once I uninstalled it with brew remove ruby, I did another which and it was pointing to a 2.0.0 version in /usr/bin.

Notice that brew install ruby actually calls a tar ball named ruby-2.1.1_1.mavericks.bottle.tar.gz . Maybe for the Mavericks version of OS X, brew fetches a different version of ruby.

I restarted RubyMine and loaded this version in the SDK and Gems configuration pane under Preferences (RubyMine.png).

In this screenshot, RubyMine shows ruby-2.1.1-p76. If I select gems in that SDK, the gem root at the bottom of the screenshot has the path 2.1.1_1 in it.

In RubyMine, I opened my folder containing my Rails project. No complaints from RubyMine.

I launched the command 'Debug: Development <Project name>'. RubyMine said I didn't have gembase installed (Gembase.png) to debug my Rails application.

I let RubyMine download the gem. The debugger launched and I could debug my application without any problems.

Lesson learned: Ruby is a great language. Ruby is a pain to configure.


Hopefully, this experience will help other users in this forum.

Louis-Philippe



Attachment(s):
Gembase.png
RubyMine.png
Terminal.png
0

Please sign in to leave a comment.