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.
Install gemsIn the invoked popup, start typing bundler, select bundle install and press Enter . Select Tools | Bundler | Install from the main menu. Open the Gemfile, place the caret at any highlighted gem missing in the project SDK and press Alt+Enter . Select Install missing gems using 'bundler' and press Enter .
A Gemfile is a file that is created to describe the gem dependencies required to run a Ruby program. A Gemfile should always be placed in the root of the project directory.
Actually running ruby mine from console through bundle helps!
$ bundle exec rubymine
Good luck!
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With