开发者

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

开发者 https://www.devze.com 2023-01-25 00:07 出处:网络
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.

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

精彩评论

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