Rubymine - missing gems

Hi,

I'm using Rubymine (version 4.5.3) and my environment looks like described here (http://stackoverflow.com/questions/17190049/rake-task-or-bundle-exec-rake-task):

Ruby version: ruby-1.9.3-p429 [ x86_64 ]
Rails version: 3.2.8

I'm not able to execute "rake db:prepare" on command line but - as answered on stackoverflow - it's not recommended to use it this way. Instead of "bundle exec rake task" should be used.

But even if everything is working as expected on CLI, Rubymine compains about missing gems and tests cannot be executed as well.

Here is the output of Rubymine:

3:00:34 PM RubyMine Gem Manager
           RubyMine has detected that
           some of the gems required for 'prototyp1'
           are not installed
           Install missing gems
           (show balloon)
3:00:34 PM RubyMine Database Integration
           Rails data sources detected, but some
           additional drivers are required for RubyMine
           to connect to the database
           Download drivers
           (show balloon)
3:01:17 PM Error running users_spec: RSpec support is disabled because 'rspec-rails' gem or RSpec Rails plugin are missing. Install and activate gem at first

I clicked on the "Install missing gems" and Rubymine is just installing the gems somewhere again (Note: the gemset used in Rubymine - Settings/... - is correct and matches the gemset used on CLI):

/home/katarina/.rvm/rubies/ruby-1.9.3-p429/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/katarina/.rvm/gems/ruby-1.9.3-p429@prototyp1/bin/bundle install
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Installing rake (10.0.4)
Installing i18n (0.6.4)
Installing multi_json (1.7.7)
Installing activesupport (3.2.8)
Installing builder (3.0.4)
....

Why is that necessary and where should I tell Rubymine which environment must be used when starting rake tasts and so on? I did it already by picking the right gemset in Menu / Settings.... Are there any temporary files which contain the wrong values?

When I click "Run.../ "Run users_spec" I get this error:

        Cannot find RSpec runner script for RVM: ruby-1.9.3-p429 [prototyp1] SDK

(Maybe this has nothing to do with the previous trial of Rubymine to install the gems again rather than using the configured gemset.)    

Answers are appreciated!
Thank you
golbie



Attachment(s):
setting_gemset.png
5 comments

Hi,

on the screenchot you have provided "Apply" button is enabled and this make me think that you have not set sdk for the project, so I'd suggested to doublecheck this.
Also from bundler's output you have provided it looks like the gemset the project uses didn't have required sdk's and bundler installed this
thus RM's warning (about missing gems) was correct
As for rspec: it looks like RM believes that your project is a rails one and it wants to have rspec-rails to run rspec tests.  It looks like a reasonalbe requirement for me but
I'm opened for discussion and ready to change this as soon as I will be sure that this is a redundant requirement.

Hope I've answered all your questions.

Regards, Oleg.

0

hi Oleg,

thank you for answering my question!

I opened the Settings dialog again and it looks like this (see setting_sdk.png). I didn't do anything. Is it defined properly now?

I just tried to execute the tests by running "Run 'spec' (Shift + F10)" and obtained this error message again (see att. tests_still_not_working.png):

/home/katarina/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/katarina/.rvm/gems/ruby-1.9.3-p194@prototyp1/bin/rake spec
Testing started at 10:58 AM ...
rake aborted!
Could not find multipart-post-1.2.0 in any of the sources
/home/katarina/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/spec_set.rb:90:in `block in materialize'
/home/katarina/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/spec_set.rb:83:in `map!'
/home/katarina/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/spec_set.rb:83:in `materialize'

As you can see multipart-post-1.2.0 is specified explicitely in Gemfile and I ran "bundle install" from the command line before.

Do you have any ideas? Should I remove all the ".idea" specific stuff from the directory and re-import the directory into IDE?

Thank you in advance.
golbie



Attachment(s):
tests_still_not_working.png
setting_sdk.zip
0

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.

Regards, Oleg.

0

hi Oleg,

you are right.. and I'm confused as well. I opened the SEttings dialog again and there was another ruby gemset again (-p194). I DONT know why. I put the value -p429@prototyp1 and  currently I'm able to execute the tests.

Are there any side effect which occur when I'm running two Ruby projects with different settings? (I actually cannot imagine.)

Sorry for this confusion. My issue is resolved now.

thank you again.
golbie

0

Great,  I'm happy to hear that the problem is fixed now.

Have a nice day ;)

0

Please sign in to leave a comment.