ItayM
ItayM

Reputation: 912

RubyMine - adding controllers

I'm really new with Ruby and Rails. I've just installed RubyMine + the Gems and everything. I'm trying to add new Control by using Tools -> run rails generator after select Controler and give a name (lets say "hello") i'm getting the following output:

D:\Ruby193\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) 

D:/Ruby193/NewTest/script/rails generate controller hello -s
D:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/resolver.rb:280:in `resolve': Could not find gem 'sass-rails (~> 3.1.5.rc.2) x86-mingw32' in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)
    from D:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/resolver.rb:160:in `start'
    from D:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/resolver.rb:128:in `block in resolve'
    from D:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/resolver.rb:127:in `catch'
    from D:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/resolver.rb:127:in `resolve'
    from D:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/definition.rb:151:in `resolve'
    from D:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/definition.rb:90:in `specs'
    from D:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/definition.rb:135:in `specs_for'
    from D:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/definition.rb:124:in `requested_specs'
    from D:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/environment.rb:23:in `requested_specs'
    from D:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:11:in `setup'
    from D:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:110:in `setup'
    from D:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/setup.rb:17:in `<top (required)>'
    from D:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
    from D:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
    from D:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from D:/Ruby193/NewTest/config/boot.rb:6:in `<top (required)>'
    from D:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from D:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from D:/Ruby193/NewTest/script/rails:5:in `<top (required)>'
    from -e:1:in `load'
    from -e:1:in `<main>'

Process finished with exit code 1

Upvotes: 1

Views: 1026

Answers (1)

Peter Andersson
Peter Andersson

Reputation: 2047

You must run Bundler first by selecting Tools - Bundler - Install and then click Install button (valid for Rubymine 5.4).

Bundler then downloads and installs all gems listed in Gemfile

After that you should be able to generate your controller using the menu.

If you prefer you could also run manually (from console)

rails g controller hello -s

Rubymine will pickup the changes. If not you can right-click on project and select Synchronize.

Upvotes: 1

Related Questions