RubyMine - 添加控制器

发布于 2024-12-19 22:43:04 字数 2382 浏览 0 评论 0原文

我对 Ruby 和 Rails 还很陌生。 我刚刚安装了 RubyMine + Gems 和所有东西。 我正在尝试使用“工具”->“添加新的控件”运行轨道发电机 选择控制器并给出名称(让我们说“你好”)后,我得到以下输出:

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>'

进程已完成,退出代码为 1

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

帅的被狗咬 2024-12-26 22:43:04

您必须首先通过选择“工具”-“Bundler”-“安装”来运行 Bundler,然后单击“安装”按钮(对 Rubymine 5.4 有效)。

然后 Bundler 下载并安装 Gemfile 中列出的所有 gem,

之后您应该能够使用菜单生成控制器。

如果您愿意,也可以手动运行(从控制台),

rails g controller hello -s

Rubymine 将拾取更改。如果没有,您可以右键单击项目并选择同步。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文