Ruby on Rails: Disable database connection

by toy

Well, I have just entered to the world of ruby. After walked through a demo application. I suddenly encountered a little problem. I created a demo application and it required to use database connection to mysql, or simply Active Record, which I don’t want to because it’s just a demo application. And every time I refresh my application, WebBrick will give me a error about database connection failed. Here’s how to shutdown the Active Record system

In environment.rb looking for the line

1
2
3
# Skip frameworks you're not going to use. To use Rails without a database,
# you must remove the Active Record framework.
#config.frameworks -= [ :active_record, :active_resource, :action_mailer ]

Uncomment the line config.frameworks… to be

1
2
3
# Skip frameworks you're not going to use. To use Rails without a database,
# you must remove the Active Record framework.
config.frameworks -= [ :active_record, :active_resource, :action_mailer ]

Simply just that!.