Question

When I open the Gemfile inside RubyMine I can Ctrl+Click on every one of the gems and RubyMine will take me to the gem's source files. Except 'rails'..

In my current project it's

gem 'rails', '3.2.13.rc2'

And I also can't see rails in the 'External Libraries' section.

Any idea how to solve this?

Était-ce utile?

La solution 2

With the helpful information in @zrl3dx's answer I did the following:

Going to some external library in RubyMine to see where it's looking for source files. In my case it was in

~/.rvm/gems/ruby-2.0.0-p247/gems

Then I copied the railties directory to the rails directory

rmdir rails-3.2.13.rc2
cp -a railties-3.2.13.rc2 rails-3.2.13.rc2

Then RubyMine automatically detected the source code and I can happily Ctrl+Click once again :)

Autres conseils

Rubymine is working fine, that's an 'issue' with Rails itself. Unfortunately, I don't have enough knowledge to say it for sure, but I suppose Rails 3.2.x folder is just a stub. I've tested that in my projects and indeed, project using Rails 3.2.13 have empty rvm rails-3.2.13 dir. I've downgraded it few times and rails-3.1.12 contains a single file rails.rb which just requires `railties-3.2.1/lib' where whole Rails are.

I have also another project using Rails 2.3.5 and there rails-2.3.5 contains Rails files, I have also another one using Rails 4.0.2 (why work with one project if you can work with few? ;)) where rails-4.0.2 dir contains only guides.

So, to answer your question: Rubymine sees empty rails-3.2.13.rc2 dir so it can't show you its source. To look into Rails source open railties-3.2.13.rc2/lib/rails directory.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top