How to configure Ruby on Rails with no database?

前端 未结 6 1928
情歌与酒
情歌与酒 2020-11-30 19:27

It would be convenient to use Ruby on Rails for a small website project that has no current need for a database. I know I could create an empty database in MySQL and go fro

6条回答
  •  时光说笑
    2020-11-30 19:51

    In Rails 4 when starting a new project you can use -O or --skip-active-record

    rails new my_project -O
    rails new my_project --skip-active-record
    

    If you've already created a project you will need to comment

     require "active_record/railtie"
    

    from config/application.rb and

     config.active_record.migration_error = :page_load
    

    from config/environments/development.rb

提交回复
热议问题