开发者

Ruby on Rails: rails generate migration is not giving me a new migration, but giving me an app called generate

I typed this into terminal:

rails generate migration CreateAddress

and instea开发者_StackOverflow中文版d of creating a new migration file, it created the entirety of a naked rails app.

What is wrong here?


The generate script is a Ruby script, so you should just call it with ruby.

Also, you usually want to call that script from the top level of your app, so:

$ ruby script/generate migration CreateAddress

The reason you have your issue is because executing rails simply creates a naked Rails app in your current directory with the first argument as its name. In this case, that's obviously "generate".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜