How to add ActiveRecord to rails application initialized without ActiveRecord?

I created a rails application with the -O option (i.e. without ActiveRecord). But now I want to add an active record to it. How can i do this?

+4
source share
1 answer

Inside config/application.rb you should see where the ActiveRecord railie mark is checked (see below).

 # Pick the frameworks you want: # require "active_record/railtie" require "action_controller/railtie" require "action_mailer/railtie" require "active_resource/railtie" require "sprockets/railtie" require "rails/test_unit/railtie" 

Uncomment it.

Also, be sure to add the database.yml file and the gem of the database adapter (e.g. sqlite3 ) to your sqlite3 .

+10
source

Source: https://habr.com/ru/post/1401519/


All Articles