Ruby on Rails New project does not use database, configuration process logging

Source: Internet
Author: User
Tags stack trace ruby on rails






Queried the experience of the great God



Http://stackoverflow.com/questions/19078044/disable-activerecord-for-rails-4



Http://stackoverflow.com/questions/821251/how-to-configure-ruby-on-rails-with-no-database



The one I liked the most was the way I used it.


If you is creating a new application, you can use-O to skip activerecord:rails new My_app-ofor Existing applications:1. Remove Database Adapter Gems fromyour Gemfile (MYSQL2, Sqlite3, etc.)2. Change your config/Application.rbremove require'Rails/all line and require frameworks your want to use, for example:require"Action_controller/railtie"require"Action_mailer/railtie"require"Sprockets/railtie"require"Rails/test_unit/railtie"3. Delete your config/database.yml file, db/schema.rb andMigrations (ifAny )4. Delete Migration Checkinchtest/test_helper.rb5. Delete any ActiveRecord configuration fromYour config/environments files (this isWhat iscausing your error)

This step directly deletes all the files in environments. isAll need to do forAn empty Rails app. If you run to problems caused by your existing code, stack trace should give you sufficient information on what do you need to the change. You might forExample have some ActiveRecord configurationinchYour initializers.


6. Remove the call to model from the controller and delete the model's dependency on ActiveRecord





Ruby on Rails New project does not use database, configuration process logging


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.