RubyMine not recognising gems installed with bundler in the editor
I'm having difficulties getting RubyMine to see my gems properly. The problem I'm seeing is that the editor screen does not recognise any classes for any gems eg for MyClass < ActiveRecord::Base, I see a yellow warning:
Cannot find 'ActiveRecord'.
I'm using bundler and I have my gems configured per project and installed in /some/project_dir/.bundle/gems
I've seen this bug: http://youtrack.jetbrains.com/issue/RUBY-14542, so I'm attempting to work round this by launching RubyMine as follows:
My RubyGems environment looks correct - here is the relevant extract:
.... Sdk Gem paths: ~/.rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/gems /some/project_dir/.bundle/gems/ruby/1.8/gems ~/.rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/bundler/gems /some/project_dir/.bundle/gems/ruby/1.8/bundler/gems Gems used for 'project': rails (bundled) /some/project_dir/.bundle/gems/ruby/1.8/bundler/gems/rails-857c6ee62c05 rspec (bundled(1.3.2)) /some/project_dir/.bundle/gems/ruby/1.8/gems/rspec-1.3.2
So it appears that it is using the correct path for the gems:
/some/project_dir:ls -1 /some/project_dir/.bundle/gems/ruby/1.8/gems Ascii85-1.0.1 Ascii85-1.0.2 GeoRuby-1.3.3 abstract-1.0.0 ....
I see the gems listed under the Ruby SDK and Gems preferences pane, but the editor pane doesn't recognise any files from within them.
This seems like a similar issue, but I still see problems even using the workaround specified.
Update: I upgraded from rails 2.3 to rails 3.0 (by upgrading the Gemfile and running bundle install), I am now able to see the rails source in the editor, but none of the other gems. Rails is installed with the :github=> directive:
gem 'rails', :github => 'rails/rails', :branch => '3-0-stable'
So I'm thinking this might be something to do with it.
Cross posted to this bug: http://youtrack.jetbrains.com/issue/RUBY-14542
I had a similar problem and the fix turned out to be removing the ruby SDK (in preferences->Ruby SDK and Gems) and then adding it back. That bumped the "Language level" from 2.1 to 2.2 and allowed Rubymine to find bundled gems in ruby 2.2.0/gems. I don't know how Rubymine managed to set language level for my ruby-2.2.1-p85 to 2.1, but this was a subtle problem that is hard to track down, so I thought I'd share in case anyone else experiences it. I only discovered it by using the extremely helpful Tools->Show Gem Environment, which may help troubleshoot similar issues.
Bundler - Help, I had a similar problem and the fix turned out to be removing the ruby SDK (in preferences->Ruby SDK and Gems) and then adding it back. That bumped the Open the Gemfile, place a caret to any highlighted gem missing in the project SDK and press Alt+Enter. Select Install missing gems using 'bundler' and press Enter.
Maybe you should just set the correct Ruby in RubyMine settings menu.
Go to "File" -> "Settings" -> "Ruby SDK and Gems" (in the list at left side) and select the correct version of the Ruby.
Rubymine can't find gems. – IDEs Support (IntelliJ Platform), As a rule, the installed Ruby interpreter comes with Bundler installed. If not, you can install Bundler to the project SDK in one of the following ways: RubyMine processes this configuration file to detect that gems are installed into In the Edit Project Path Mappings dialog, specify the local and remote project root paths:. I installed the bundle with the --path option on bundler and RubyMine IDE isn't even complaining about missing gems. If installing the bundle without --path option (which means standard gem path is used) the gems do show up in "Project -> External Libraries".
On RubyMine for Mac, still had the same issue with not finding gems. Instead of default settings from File, you need to change: RubyMine => Preferences => Languages and Frameworks => RubySDK and Gems
Then select the correct version.
The best way to manage a Ruby application's gems, Hi Folks, My trial of Rubymine is coming to an end, and to be fair I've had a Rubymine will detect the correct version of the interpreter to use (from code editor will always underline the require 'gem-xxx' with the tooltip "no such file to load". I haven't ever used bundler (I don't do rails development), I just @Alexey That doesn't seem to be it. There's no bundler version specified in the Gemfile. All of the CLI bundler commands work fine. It's Rubymine that has a problem. It looks like RM is not constructing the bundle command correctly, but I'm not sure what it should be in the context of RM or even where I would reconfigure RM to fix it.
I had a similar issue. Rbenv was making use of an older version of ruby vs what RubyMine was using.
I had to set the local version using Rbenv and then use the same version in RubyMine. This means that running
bundle install in a terminal window will install the gems into the correct "gem set"
To set the Rbenv version:
rbenv local 2.5.1
How to fix: Gems are unavailable although they are installed , Opens the source directory of the provided GEM in your editor. For this to work the `EDITOR` or `BUNDLER_EDITOR` environment variable has to be set. Hi, it looks very strange for me, accourding to your settings' screenshot you are using ruby-1.9.3-p429, but the test is executed with ruby-1.9.3-p194 :( Could you please check settings of the run configuration you are runnig.
Why doesn't RubyMine 2018.2 detect my gems?, Also, don't run bundle install as root (or sudo it), especially not in your release directory. Hint for github shorthand. If your using something like gem 'font-awesome- I'm able to install the old versions, but how do I set that older version as the active gem. I'm use to gemfiles and CLI, so this rubymine implementation is a little confusing. Lastly, is it possible to install just the gems in my gemfile in Rubymine? This would solve all my problems! Thanks, Nick
Setting up a Ruby development environment, When I start the editor I get a warning: bash -c "RBENV_VERSION=2.5.0 /usr/bin/rbenv exec bundle install -V" Activating echo $RBENV_VERSION (no response) > cat ~/.rbenv/version 2.5.0 > rbenv global 2.5.0 RubyMine's Ruby SDK settings correctly detect rvm and its installed versions, and all of Clicking on "Install missing gems" brings up this alert: No bundler gem found, but Gemfile is present. Would you like to install bundler and use it to install missing gems? [Yes][No] Bundler is installed already, but I click yes anyways and I see a progress bar. Eventually at the bottom I will see 1 gem installed and the progress bar goes away.
JetBrains RubyMine, Install an editor (optional). Ruby's installation instructions vary by operating system. Run your Ruby project only using gems defined in your Gemfile . Popular editors (in no particular order) used to develop Ruby apps include, but aren't by Jon Skinner; Atom by GitHub; RubyMine by JetBrains; Vim by Vim the editor. Then run 'gem install 'rails''. Hint: it's possible to use Terminal within RubyMine. 4. Bundler (bundler.io) Put Rails gem into the Gemfile of already existing application and run 'bundle install' in the folder of the project. If you'd like to use a certain Rails version, specify it in the Gemfile to install it into SDK.