14
votes

I am using RubyMine IDE with RVM for Ruby version management and

bundler install --path vendor/bundle

to keep my gems local. However, RubyMine doesn't seem to be reading my .bundle/config file which specifies where my gems are located with the BUNDLE_PATH property:

BUNDLE_PATH: vendor/bundle
BUNDLE_DISABLE_SHARED_GEMS: '1'

I have found some sources which indicate that RubyMine should support this, but can't seem to find any explanation of exactly how it works or how to fix it properly.

This thread seems to indicate that RubyMine should pick up the bundler/config

"if you configured bundler to install gems in vendor/bundle by-default then RM is supposed to handle this (and if it is not then this is a bug)." http://devnet.jetbrains.com/thread/441239

Here's a few more RubyMine bugs indicating it is not working:

I also saw a stackoverflow thread, Using RVM Gemsets & Bundler & RubyMine, where someone complained about the same problem, but the solution was simply to install the gems under the RVM managed path by doing the following:

bundle install --system

Well, this defeats the purpose of keeping your gems isolated between projects. I know there are gemsets for this, but I much prefer not to use them.

The error I am seeing is the following when I try to run my project from RubyMine:

Error running Development: [No Rails found in SDK]

The other symptom is that my gems installed under vendor/bundle aren't visible under the "External Libraries" in the project view, only my Ruby SDK and bundler are installed here.

Also, this works and starts my server find from the command line: bundle exec rails server

But even when I try to run my server with "Run the script in the context of the bundle (bundle exec)", it still fails.

5
Just wondering if you made any more progress with this - see also stackoverflow.com/questions/22054219/…robd
ryanbigg.com/2013/08/bundler-local-paths support would be very helpfulaceofspades

5 Answers

5
votes

Actually running ruby mine from console through bundle helps!

$ bundle exec rubymine

Good luck!

2
votes

Checkout the workarounds posted here:

http://ruby-on-rails.wikidot.com/rubyminelocalbundlepathbug

Workaround #1:

Use a global bundler configuration. Make sure to remove your local bundler configuration too or this won't work.

bundle config --delete path
bundle config --global path vendor/bundle

Workaround #2:

Override the GEM_HOME when starting RubyMine

GEM_PATH="/home/user/project/vendor/bundle/gems/" rubymine
1
votes

I got the dreaded "Error running Development: [No Rails found in SDK]" error when I had installed my Gems via bundle install --path vendor/bundle. It seems like the --path vendor/bundle confused RubyMine in some way.

Run bundle install without --path vendor/bundle. Note: if you already ran bundler once with --path vendor/bundle, you should either clone a fresh copy of the repo or clean out anything installed by Bundler, like so:

rm -rf .bundle
rm -rf vendor/bundle
bundle install
0
votes

As discussed in RUBY-16428, I have written a ruby script which adds the correct gem dependencies as a Rubymine library. Note, this uses features of Rubymine which aren't exposed in the RubyMine UI, based on my workaround using Intellij Idea I described in RUBY-16428.

If you have problems, please feel free to comment on the gist, and I will do my best to help.

https://gist.github.com/robd/ebd2570cc8c50bcda072

0
votes

Try to remove the ruby's version (2.3.1 in my case)

rvm remove 2.3.1

Remove the .idea from your project(s)

Install this libraries (one of them resolved to me, I don't know which)

brew install v8 apple-gcc42 gcc49 ruby-build

Reinstall the ruby

rvm install 2.3.1

Downgrade the rubygem

rvm rubygems 2.5.1 --force

Enter you project's folder and do:

bundle install