rails 生成迁移 table 名称命令未在 db/migrate 中创建迁移
rails generate migration table name command does not create migration in db/migrate
我是运行
$ rails generate migration Tablename
命令提示符中的命令。我应该在 db/migrate 中看到新创建的 table 吗?我是 rails.
的新人
我可以看到以下错误:
rails generate migration TruncateUnusedTables
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/run.rb:98:in `gets': Interrupt
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/run.rb:98:in `verify_server_version'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/run.rb:56:in `run'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/run.rb:37:in `warm_run'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/run.rb:26:in `call'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/command.rb:7:in `call'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/rails.rb:24:in `call'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/command.rb:7:in `call'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client.rb:28:in `run'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/bin/spring:49:in `<top (required)>'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/binstub.rb:11:in `load'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/binstub.rb:11:in `<top (required)>'
from .rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from .rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I am new in rails.
欢迎光临!我们随时为您提供帮助。
Should I see the newly created table in db/migrate?
与 $ rails generate migration Tablename
无关。您将需要配置迁移,以便创建 table。这是一个很大的话题,因此请前往 guides 阅读有关生成迁移的内容。
我是运行
$ rails generate migration Tablename
命令提示符中的命令。我应该在 db/migrate 中看到新创建的 table 吗?我是 rails.
我可以看到以下错误:
rails generate migration TruncateUnusedTables
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/run.rb:98:in `gets': Interrupt
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/run.rb:98:in `verify_server_version'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/run.rb:56:in `run'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/run.rb:37:in `warm_run'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/run.rb:26:in `call'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/command.rb:7:in `call'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/rails.rb:24:in `call'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client/command.rb:7:in `call'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/client.rb:28:in `run'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/bin/spring:49:in `<top (required)>'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/binstub.rb:11:in `load'
.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spring-1.5.0/lib/spring/binstub.rb:11:in `<top (required)>'
from .rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from .rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I am new in rails.
欢迎光临!我们随时为您提供帮助。
Should I see the newly created table in db/migrate?
与 $ rails generate migration Tablename
无关。您将需要配置迁移,以便创建 table。这是一个很大的话题,因此请前往 guides 阅读有关生成迁移的内容。