Run Configuration Error: Rails 3.x launcher script was found instead of Rails 2.x one.

I have been using RubyMine for a couple of weeks now with a rails3.1.0.rc4 and ruby 1.9.2, and rvm.
Today after doing a git pull I started getting the following error:

Run Configuration Error: Rails 3.x launcher script was found instead of Rails 2.x one.

From the command line I can do a 'gem list'  see that my rails and action* and active* gems are version 3.1.0.rc4

I can still run rails from the command line, and I can run the rails console from the IDE, but I can't run or debug rails from the IDE.

Going to the File/Settings/Ruby SDK and Gems show a rails gem with a version of 4c4928 (weird). Missing are the action* active* gems.
From the IDE I do a gem install and it pulls down rails 3.1.0.rc5 and now I see the the action* and active* gems with version of 3.1.0.rc5, although there is still the weird rails version 4c4928

And when I try to run the rails server from the IDE, I still get this Run Configuration Error: Rails 3.x launcher script was found instead of Rails 2.x one. error.

Doing a gem list at the command line does not show this weird rails version 4c4928.

Anyone have a clue as to how I fix this?

10 comments
Comment actions Permalink

I should note I found the following line in:  .idea/workspace.xml

620:    <entry file="file://$USER_HOME$/.rvm/gems/ruby-1.9.2-p290@cmf/bundler/gems/rails-4c492865b16b/actionpack/lib/action_controller/metal/implicit_render.rb">

This may have been brought over in the git pull command

0
Comment actions Permalink

Hi Fred,

Could you show your Gemfile?

0
Comment actions Permalink

I also have the same problem, my gem is

source 'http://rubygems.org'

#gem 'rails', '3.1.0.rc4'
gem 'rails', :git => 'git://github.com/rails/rails.git', :branch => '3-1-stable'
gem 'sprockets', :git => 'git://github.com/sstephenson/sprockets.git'

gem 'nokogiri', "~> 1.4.6"
gem 'pg'
gem 'sqlite3', :require => 'sqlite3'
gem 'kaminari'
gem "devise", "~> 1.4.2"
gem "cancan", "~> 1.6.5"
gem "ransack"
gem "simple_form"
gem "heritage"
gem "validates_timeliness"

# Asset stuff
gem 'sass-rails', :git => 'git://github.com/rails/sass-rails.git', :branch => '3-1-stable'
gem 'coffee-script', '2.2.0'
gem 'uglifier', '1.0.0'
gem 'jquery-rails', '1.0.12'

group :development, :test do
  gem 'annotate-models', '1.0.4'
  gem 'faker', '0.3.1'
  gem 'webrat'
  gem 'factory_girl', '2.0.1'
  gem 'factory_girl_rails', '1.1.0'
  gem 'rspec', '~> 2.6.0'
  gem 'rspec-rails', '~> 2.6.0'
  #javascripty
  gem 'execjs'
  gem 'therubyracer', '~> 0.9.3.beta1'
end

0
Comment actions Permalink

Ricardo,

Thank you for the issue. Strange version which you see is git repository version of your gem. When bundler installs git gem it doesn't show gem normal version and RubyMine uses git hash instead.

I filed two issues:

  1. RUBY-9148 Rails run configuration rails gem version validation should understand rails installed from git src
  2. RUBY-9149 Don't consider hash of git-based gem as gem version


The first one is for your concrete use case and the second is related to general dangerous place in RubyMine gem manager. The first issue is fixed and will be available in 3.2.4 minor update, the second one is about same situation but for other gems and I'll fix it 4.0 because fix is not safe and should be tested not only by our QA, but also by EAP users.

0
Comment actions Permalink

Hi Roman, thanks for your reply.

Since I reported this problem.  I have done the following....

1) removed rvm and it's repositories from the system.

2) updated my Gemfile to the following:

source :rubygems

gem 'rails', :git => 'https://github.com/rails/rails.git', :branch => '3-1-stable'
gem 'mongoid', '2.0.2'
gem 'bson_ext', '1.3.1'
gem 'mongoid-eager-loading', '0.3.1'
gem 'bcrypt-ruby', '2.1.4', :require => 'bcrypt'
gem 'haml', '3.1.2'
gem 'haml-rails', '0.3.4'
gem 'sass', '3.1.4'
gem 'coffee-script', '2.2.0'
gem 'uglifier', '1.0.0'
gem 'therubyracer'
gem 'r18n-core', '0.4.10'
gem 'r18n-rails', '0.4.10'
gem 'r18n-rails-api', '0.4.10'
gem 'inherited_resources', '1.2.2'
gem 'goalie', '0.0.4'
gem 'css3buttons'
gem 'time-lord'

group :development do
  gem 'awesome_print', '0.4.0'
  gem 'jquery-rails', '1.0.12'
end


3) ran bundle install

which installed rails (3.1.0.rc5)
4) This morning I ran gem install rails --pre

which installed rails (3.1.0.rc6)

After thisI ran: gem list | grep rails

and got

rails (3.1.0.rc6)

Then in /opt/cmf, I ran: bundle list | grep rails

and I got:

rails (3.1.0.rc5)

hmmmmm.... my bundle appears to  be out of date

So I then ran bundle update and then bundle list | grep rails

And then I got

rails (3.1.0.rc6 0df00d9)

Well! 0df00d9 seems to be an artifact of bundler?  Yes?
5) I removed  my rails-project/.idea   and ~/.RubyMine32 directories and started rubymine again

When I start rubymine, I get the following error:

Failed to load remote gems

/usr/local/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:152: stack level too deep (SystemStackError)

Please check proxy settings and gem urls.

When I navigate to edit the Development: cmf configuration, I see the following error at the bottom of the dialog box:

Run Configuration Error: Rails gem is nnot part of the bundle fro module 'cmf'

Any clue as to what is going on?

0
Comment actions Permalink

Hi,


When I start rubymine, I get the following error:

Failed to load remote gems
/usr/local/lib/ruby/1.9.1/rubygems/spec_fetcher.rb:152: stack level too deep (SystemStackError)
Please check proxy settings and gem urls.


Please update your rubygems, it is due to a bug in old versions of rubygems.

When I navigate to edit the Development: cmf configuration, I see the following error at the bottom of the dialog box:

Run Configuration Error: Rails gem is nnot part of the bundle fro module 'cmf'



RubyMine doesn't see that 'rails' gem should be used in your project. Please attach a screenshot of your "Libraries" node in project view. In 3.2.4 I wan't to remove our checks related to unattached gems from run configurations, seems user our code insight shouldn't forbid user to launch run configurations.

2) updated my Gemfile to the following:
source :rubygems
gem 'rails', :git => 'https://github.com/rails/rails.git', :branch => '3-1-stable'
gem 'mongoid', '2.0.2'
gem 'bson_ext', '1.3.1'


...hmmmmm.... my bundle appears to  be out of date

So I then ran bundle update and then bundle list | grep rails

And then I got
rails (3.1.0.rc6 0df00d9)
Well! 0df00d9 seems to be an artifact of bundler?  Yes?

As far as I understand your Gemfile still fetch rails from github, try something like this:
gem 'rails', "~>3.1.0.rc1" - it will install latest rc for rails 3.1.0. Also could you attach a screenshot of your gems list in RubyMine Settings | Ruby SDK and Gemd dialog. Select 'rails' gem there, which src path will be shown in info box under the list?

0
Comment actions Permalink

Hello Roman, thank you for your quick response.

As per your advice I ran

gem update --system

and the result was:


Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/guard-0.6.1.gemspec]: invalid date format in specification: "2011-08-15 00:00:00.000000000Z"
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/execjs-1.2.4.gemspec]: invalid date format in specification: "2011-08-03 00:00:00.000000000Z"
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/guard-0.6.2.gemspec]: invalid date format in specification: "2011-08-17 00:00:00.000000000Z"
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/sprockets-2.0.0.beta.13.gemspec]: invalid date format in specification: "2011-08-04 00:00:00.000000000Z"
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/childprocess-0.2.1.gemspec]: invalid date format in specification: "2011-08-11 00:00:00.000000000Z"
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/guard-0.6.1.gemspec]: invalid date format in specification: "2011-08-15 00:00:00.000000000Z"
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/execjs-1.2.4.gemspec]: invalid date format in specification: "2011-08-03 00:00:00.000000000Z"
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/guard-0.6.2.gemspec]: invalid date format in specification: "2011-08-17 00:00:00.000000000Z"
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/sprockets-2.0.0.beta.13.gemspec]: invalid date format in specification: "2011-08-04 00:00:00.000000000Z"
Invalid gemspec in [/usr/local/lib/ruby/gems/1.9.1/specifications/childprocess-0.2.1.gemspec]: invalid date format in specification: "2011-08-11 00:00:00.000000000Z"


== 1.8.8 / 2011-08-11

* Bug fix:
  * The encoding of a gem's YAML spec is now UTF-8.  Issue #149


------------------------------------------------------------------------------

RubyGems installed the following executables:
    /usr/local/bin/gem


So, we are halfway there.

There is some advice on how to deal with these dates here:

https://github.com/sstephenson/execjs/issues/33#issuecomment-1733646

But I cheated, and edited the offending gem spec files and changed the dates from something like this:

s.date = %q{2011-08-03 00:00:00.000000000Z}

to something like this:

s.date = %q{2011-06-17}

And running:  gem list no longer produces any errors.


I also followed your suggestion and changed the Gemfile first line from this:

gem 'rails', :git => 'https://github.com/rails/rails.git', :branch => '3-1-stable'

to this:


gem 'rails', '~>3.1.0.rc6'

And now when I start RubyMine, I have no errors.  And when I go to edit the Development: cmf configuration, there are no errors.

But when I go to run the application in the debugger, or just run the application RubyMine says either:

Debug: All specs in cmf

or

Run: All speccs in cmf

How do I switch to just debugging or running the application?


By the way the gems listed in the  RubyMine Settings | Ruby SDK and Gemd dialog are:

actionmailer    [actionmailer(3.1.0.rc6)]
actionpack    [actionpack(3.1.0.rc6)]
activemodel    [activemodel(3.1.0.rc6)]
activerecord    [activerecord(3.1.0.rc6)]
activeresource    [activeresource(3.1.0.rc6)]
activesupport    [activesupport(3.1.0.rc6)]
ansi    [ansi(1.3.0)]
arel    [arel(2.2.1)]
awesome_print    [awesome_print(0.4.0)]
bcrypt-ruby    [bcrypt-ruby(2.1.4)]
bson    [bson(1.3.1)]
bson_ext    [bson_ext(1.3.1)]
builder    [builder(3.0.0)]
bundler    [bundler(1.0.18)]
capybara    [capybara(1.0.0)]
childprocess    [childprocess(0.2.1)]
coffee-rails    [coffee-rails(3.1.0.rc.6)]
coffee-script    [coffee-script(2.2.0)]
coffee-script-source    [coffee-script-source(1.1.2)]
css3buttons    [css3buttons(1.0.1)]
database_cleaner    [database_cleaner(0.6.7)]
diff-lcs    [diff-lcs(1.1.2)]
erubis    [erubis(2.7.0)]
execjs    [execjs(1.2.4)]
fabrication    [fabrication(1.0.1)]
ffi    [ffi(1.0.9)]
forgery    [forgery(0.3.10)]
goalie    [goalie(0.0.4)]
growl    [growl(1.0.3)]
guard    [guard(0.6.2), guard(0.6.1)]
guard-bundler    [guard-bundler(0.1.3)]
guard-pow    [guard-pow(0.1.0)]
guard-rspec    [guard-rspec(0.4.0)]
haml    [haml(3.1.2)]
haml-rails    [haml-rails(0.3.4)]
has_scope    [has_scope(0.5.1)]
hike    [hike(1.2.1), hike(1.2.0)]
i18n    [i18n(0.6.0)]
inherited_resources    [inherited_resources(1.2.2)]
jquery-rails    [jquery-rails(1.0.13), jquery-rails(1.0.12)]
json_pure    [json_pure(1.5.3)]
libv8    [libv8(3.3.10.2)]
mail    [mail(2.3.0)]
mime-types    [mime-types(1.16)]
mongo    [mongo(1.3.1)]
mongoid    [mongoid(2.0.2)]
mongoid-eager-loading    [mongoid-eager-loading(0.3.1)]
multi_json    [multi_json(1.0.3)]
nokogiri    [nokogiri(1.5.0)]
polyglot    [polyglot(0.3.2)]
r18n-core    [r18n-core(0.4.10)]
r18n-rails    [r18n-rails(0.4.10)]
r18n-rails-api    [r18n-rails-api(0.4.10)]
rack    [rack(1.3.2)]
rack-cache    [rack-cache(1.0.2)]
rack-mount    [rack-mount(0.8.2)]
rack-ssl    [rack-ssl(1.3.2)]
rack-test    [rack-test(0.6.1)]
rails    [rails(3.1.0.rc6), rails(c238ba)]
railties    [railties(3.1.0.rc6)]
rake    [rake(0.9.2)]
rb-fsevent    [rb-fsevent(0.4.0)]
rdoc    [rdoc(3.9.2)]
responders    [responders(0.6.4)]
rspec    [rspec(2.6.0)]
rspec-core    [rspec-core(2.6.4)]
rspec-expectations    [rspec-expectations(2.6.0)]
rspec-mocks    [rspec-mocks(2.6.0)]
rspec-rails    [rspec-rails(2.6.1)]
rubygems-update    [rubygems-update(1.8.8)]
rubyzip    [rubyzip(0.9.4)]
sass    [sass(3.1.7), sass(3.1.4)]
sass-rails    [sass-rails(3.1.0.rc.6)]
selenium-webdriver    [selenium-webdriver(0.2.2)]
sprockets    [sprockets(2.0.0.beta.13)]
sqlite3    [sqlite3(1.3.4)]
therubyracer    [therubyracer(0.9.3)]
thor    [thor(0.14.6)]
tilt    [tilt(1.3.2)]
time-lord    [time-lord(0.1.5)]
treetop    [treetop(1.4.10)]
turn    [turn(0.8.2)]
tzinfo    [tzinfo(0.3.29)]
uglifier    [uglifier(1.0.1), uglifier(1.0.0)]
xpath    [xpath(0.1.4)]


Regards,

FredO

0
Comment actions Permalink

Hello Roman,

Today, I installed the 'cloudfiles' gem.  I can execute the application but I cannot debug it.  When I try to run the debugger, I get the following error:

/usr/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/fredo/.gem/ruby/1.9.1/gems/ruby-debug-ide-0.4.17.beta5/bin/rdebug-ide --port 57262 -- /opt/cmf/script/rails server -b 0.0.0.0 -p 3000 -e development
Fast Debugger (ruby-debug-ide 0.4.17.beta5, ruby-debug-base 0.11.28) listens on 127.0.0.1:57262
    /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs'
    /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:451:in `block in find_in_unresolved'
    /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:451:in `map'
    /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:451:in `find_in_unresolved'
    /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:43:in `require'
    /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/dsl.rb:1:in `<top (required)>'
    /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/definition.rb:17:in `build'
    /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler.rb:136:in `definition'
    /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler.rb:124:in `load'
    /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler.rb:107:in `setup'
    /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/setup.rb:17:in `<top (required)>'
    /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
    /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
    /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    /opt/cmf/config/boot.rb:6:in `<top (required)>'
    /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    /opt/cmf/script/rails:5:in `<top (required)>'
    /home/fredo/.gem/ruby/1.9.1/gems/ruby-debug-ide-0.4.17.beta5/lib/ruby-debug-ide.rb:112:in `debug_load'
    /home/fredo/.gem/ruby/1.9.1/gems/ruby-debug-ide-0.4.17.beta5/lib/ruby-debug-ide.rb:112:in `debug_program'
    /home/fredo/.gem/ruby/1.9.1/gems/ruby-debug-ide-0.4.17.beta5/bin/rdebug-ide:87:in `<top (required)>'
    -e:1:in `load'
    -e:1:in `<main>'
Uncaught exception: Could not find ruby_core_source (>= 0.1.4) amongst []

Any idea of what is wrong now?

Regards,

FredO

0
Comment actions Permalink


But when I go to run the application in the debugger, or just run the application RubyMine says either:

Debug: All specs in cmf

or

Run: All speccs in cmf

How do I switch to just debugging or running the application?

I'm not sure that I understand you correctly. Our context menu (especially run configurations part) is context specific. When you click on folder/file (in project view) or on some line in editor RubyMine tries to find saved or temporary run configuration which suits to current location (folder/file/place in file) and if cannot find creates a new temporary run configuration. Current saved and temporary (half opacity icon) run configration listed in "Run|Edit Configurations" or better "Run|Run..." popup
https://img.skitch.com/20110821-gchd8d1ekc26fi4erxy55r8adp.jpg
For rails application RubyMine configures run configurations for rails server script launching:
run_configurations.jpg
(if you don't see them you can configure it manually in "Edit Configurations" dialog.
Expected use case - use "Run.." action to launch(run/debug) rails server configuration or any custom/saved configuration. Or Run action provided by context menu to quickly create or run ruby file or tests in come context. If you try to launch migration script RubyMine will run db:migrate task instead.

0
Comment actions Permalink

Uncaught exception: Could not find ruby_core_source (>= 0.1.4) amongst []

Any idea of what is wrong now?

On Monday I'll ask Dennis, he is responsible for dubugger gems support. Probably this missing dependency is a bug in debugger gems. As a workaround try to add this gem (ruby_core_source) in your Gemfile, launch bundle update command and try again.

0

Please sign in to leave a comment.