Attaching and Detaching Gems


Think I'll start the way I usually do: LOVE YOUR IDE! Great job! Thanks! (Maybe that's corny and repetitive, but it is true :))

Okay, now on to the more mundane stuff: What is the exact purpose of attaching and detaching gems? Is it just for method documentation lookup and code completion?

The "Help" (and the code itself) says that when you go to detach a gem you will get a warning that certain dependencies might not be met - and indeed you do. However, it seemed to me that I was using gems that weren't "officially attached" and my app still worked. So I tried detaching something kinda sorta important - ActiveRecord. I got the warning, but my app still works, which leads me to believe that the warning is a little dramatic.

The reason I ask is because I'm wondering if I can reduce the startup time that is spent "indexing my project". I don't need the documentation lookup and code completion for most of my attached gems, so if I detach them will RubyMine start quicker?


Comment actions Permalink

Mostly, attaching gems is needed for code completion and documentation. But code insight is not only reason to get your gems attached. Attached gem is used to toggle some additional frameworks support, such as bundler or rspec. Also attached gem version is used to determine which exact version should be used in run configuration or when running some external command when you have different versions of same gem installed.
Detaching gems may reduce startup time only when RubyMine needs to build indexes for your project and gems files, but this should not happen every time you open your project, only if there are modified files or RubyMine crashed.

Comment actions Permalink

Got it. Thanks a lot, Dennis!

-- Larry


Please sign in to leave a comment.