新手问题 Rails 5 的 generator 老是卡住怎么办?

imwildcat · 2016年09月25日 · 最后由 fanbin0602 回复于 2016年12月01日 · 2953 次阅读

Ruby: rails -ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15] Rails: Rails 5.0.0.1

➜  mpstore rails d scaffold_controller boots_items
Running via Spring preloader in process 5156
[WARNING] The model name 'boots_items' was recognized as a plural, using the singular 'boots_item' instead. Override with --force-plural or setup custom inflection rules for this noun before running the generator.
      remove  app/controllers/boots_items_controller.rb
      invoke  erb
      remove    app/views/boots_items
      remove    app/views/boots_items/index.html.erb
      remove    app/views/boots_items/edit.html.erb
      remove    app/views/boots_items/show.html.erb
      remove    app/views/boots_items/new.html.erb
      remove    app/views/boots_items/_form.html.erb
      invoke  test_unit
      remove    test/controllers/boots_items_controller_test.rb
      invoke  helper
      remove    app/helpers/boots_items_helper.rb
      invoke    test_unit
      invoke  jbuilder
      remove    app/views/boots_items
      remove    app/views/boots_items/index.json.jbuilder
      remove    app/views/boots_items/show.json.jbuilder
      remove    app/views/boots_items/_boots_item.json.jbuilder


^C%                                                                                                                                                                     ➜  mpstore rails d scaffold_controller boots_items
Running via Spring preloader in process 5544
[WARNING] The model name 'boots_items' was recognized as a plural, using the singular 'boots_item' instead. Override with --force-plural or setup custom inflection rules for this noun before running the generator.
      remove  app/controllers/boots_items_controller.rb
      invoke  erb
      remove    app/views/boots_items
      remove    app/views/boots_items/index.html.erb
      remove    app/views/boots_items/edit.html.erb
      remove    app/views/boots_items/show.html.erb
      remove    app/views/boots_items/new.html.erb
      remove    app/views/boots_items/_form.html.erb
      invoke  test_unit
      remove    test/controllers/boots_items_controller_test.rb
      invoke  helper
      remove    app/helpers/boots_items_helper.rb
      invoke    test_unit
      invoke  jbuilder
      remove    app/views/boots_items
      remove    app/views/boots_items/index.json.jbuilder
      remove    app/views/boots_items/show.json.jbuilder
      remove    app/views/boots_items/_boots_item.json.jbuilder

^C%   

执行 rails g 或者 rails d 的时候经常执行到一大半卡住,然后无响应了。

试试换个项目名字

boot_items

#1 楼 @lithium4010 任何名字都会这样

可以 看看是不是数据库没有链接上之类

本地环境 gem install spring 试试

bundle config --delete bin    # Turn off Bundler's stub generator
rails app:update:bin          # Use the new Rails 5 executables
git add bin                   # Add bin/ to source control
需要 登录 后方可回复, 如果你还没有账号请 注册新账号