lfx_cool lfx_cool - 1 year ago 104
Ruby Question

where are my gems installed with rbenv?

I use rbenv and bundler, I want open the installed rails gem and insert some debug codes. So I run 'bundle show rails' in a rails project, I get '~/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rails-3.2.11', but there is nothing in this directory.

Answer Source

Rails is just a meta-gem, as-in it doesn't contain any actual code, it just lists dependencies that make up Rails. This is why the gem's directory is empty.

If you want to edit part of the Rails code you should edit the relevant dependency. In a Gemfile.lock the direct dependecies of Rails 3.2.11 are listed as follows:

rails (3.2.11)
  actionmailer (= 3.2.11)
  actionpack (= 3.2.11)
  activerecord (= 3.2.11)
  activeresource (= 3.2.11)
  activesupport (= 3.2.11)
  bundler (~> 1.0)
  railties (= 3.2.11)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download