mooffie / drx

An object inspector for Ruby

Home Page:http://drx.rubyforge.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rails and DrX

ryanmt opened this issue · comments

Hey, I really am stoked to have found DrX today. It looks awesome and like it will save me lots of time. That being said, it seems to fundamentally fail when trying to play with Rails. I don't want to model Rails, but my libraries I'm trying to map play next to Rails, and it seemed like there would be a larger user base for your gem if these played together.

Here is what I see:

If I try to load rails console and then require 'drx' =>

Loading development environment (Rails 3.1.3)  
ruby-1.9.3-p0 :001 > require 'drx'  
LoadError: cannot load such file -- drx
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'  
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'  
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency'  
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from (irb):1
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands/console.rb:45:in `start'
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands/console.rb:8:in `start'
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/commands.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

If I try to load my environment in an irb session I get the same error.

If I load drx first, I get the following, after a successful load =>

ruby-1.9.3-p0 :007 > Msrun.see
LoadError: cannot load such file -- drx/tk/app
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/drx-0.4.5/lib/drx.rb:11:in `see_using_tk'
from /home/ryanmt/.rvm/gems/ruby-1.9.3-p0/gems/drx-0.4.5/lib/drx.rb:31:in `see'
from (irb):7
from /home/ryanmt/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>'

A bit late, but there are some good instructions here:

http://www.rubyinside.com/drx-visually-inspect-ruby-objects-3233.html

Basically, you need Tk support compile into ruby. I know some 1.9.2's have it, not sure about 1.9.3 you are using though. I think it's just that, no Tk support. You can compile ruby with it, although I'm not sure exactly how. That article I linked above has some comments at the bottom that detail the ways to install it via RVM.