我是 Rails 的新手。
我想在 Rails 5 中禁用 ActiveRecord。
我已经找到了几个答案Here https://stackoverflow.com/questions/28319002/how-do-i-remove-activerecord-from-an-existing-rails-4-application, Here https://stackoverflow.com/questions/821251/how-to-configure-ruby-on-rails-with-no-database and Here https://stackoverflow.com/questions/19078044/disable-activerecord-for-rails-4
但他们似乎都不适合我。
请你帮我解决这个问题好吗?
Thanks.
只是更新一下,如果您使用的是 Rails 5 或更高版本,则无需手动删除任何内容。
对于 Rails 版本 5 或更高版本中的新 Rails 应用程序,所有这些都已处理。只需运行 Rails new 命令即可-O
(--skip-active-record
) 争论。
> rails new proj_no_db -O
对于没有 DB 的仅 api Rails 应用程序,
> rails new proj_api_no_db -O --api
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)