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

imwildcat · September 25, 2016 · Last by fanbin0602 replied at December 01, 2016 · 2941 hits

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
You need to Sign in before reply, if you don't have an account, please Sign up first.