Can we start (or) run a rails application without any database?
How can I do it?
At the beginning of your config/application.rb file you should have something like this:
require File.expand_path('../boot', __FILE__)
# 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"
When you remove this line:
require "active_record/railtie"
ActiveRecord will be gone and your app won't require a database connection.
You can also create the project with --skip-activerecord if it's a new one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With