OK, here I found some ways to tell, that you are running from inside of RubyMine
(puts this into your Gemfile to test it)
puts [
ORIGINAL_ENV['OLDPWD'],
ORIGINAL_ENV['RM_INFO'],
ORIGINAL_ENV['RUBYLIB'],
ORIGINAL_ENV['RUBYMINE_TESTUNIT_REPORTER'],
ORIGINAL_ENV['TEAMCITY_RAKE_RUNNER_MODE'],
ORIGINAL_ENV['TEAMCITY_RAKE_RUNNER_USED_FRAMEWORKS'],
ORIGINAL_ENV['XPC_SERVICE_NAME']
]
So for example this way I am able to install gems for RubyMine, only when it is really needed
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console'
gem 'listen', '~> 3.0.5'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
if ORIGINAL_ENV && ORIGINAL_ENV['TEAMCITY_RAKE_RUNNER_MODE']
gem 'debase'
end
end
Only bad thing is, that this will be changing Gemfile.lock