# Can I Use RoR without Database?

**URL:** <https://www.ruby-forum.com/t/can-i-use-ror-without-database/179682>\
**Category:** Rails\
**Created:** [December 1, 2009, 9:05pm UTC](https://www.ruby-forum.com/t/can-i-use-ror-without-database/179682 "2009-12-01T21:05:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zealander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e19b73/32.png) [@zealander](https://www.ruby-forum.com/u/zealander)\
**Post date:** [December 1, 2009, 9:05pm UTC](https://www.ruby-forum.com/t/can-i-use-ror-without-database/179682/1 "2009-12-01T21:05:14Z")

</div>

Hello,

I’m having trouble getting MySQL work on Vista with Norton Security and  
because of that I can’t get RoR to display a simple “Hello World!”  
message.

I was wondering, can RoR work without database? I don’t need it at this  
point.

---

<div class="post-metadata">

**Author:** ![zealander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e19b73/32.png) [@zealander](https://www.ruby-forum.com/u/zealander)\
**Post date:** [December 1, 2009, 9:13pm UTC](https://www.ruby-forum.com/t/can-i-use-ror-without-database/179682/2 "2009-12-01T21:13:58Z")

</div>

Vi Le wrote:

> Hello,
> 
> I’m having trouble getting MySQL work on Vista with Norton Security and  
> because of that I can’t get RoR to display a simple “Hello World!”  
> message.
> 
> I was wondering, can RoR work without database? I don’t need it at this  
> point.

Then you very likely don’t need Rails. Rails should be able to work  
without a DB, but it loads ActiveRecord anyway. Perhaps you want Merb  
or Sinatra?

Best,  
–Â  
MarnenÂ Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![zealander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e19b73/32.png) [@zealander](https://www.ruby-forum.com/u/zealander)\
**Post date:** [December 2, 2009, 12:13pm UTC](https://www.ruby-forum.com/t/can-i-use-ror-without-database/179682/3 "2009-12-02T12:13:01Z")

</div>

Hi,

Find this in your environment.rb and comment/remove/modify as needed.

# 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  
]

Cheers.

---

<div class="post-metadata">

**Author:** ![zealander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e19b73/32.png) [@zealander](https://www.ruby-forum.com/u/zealander)\
**Post date:** [December 2, 2009, 8:28pm UTC](https://www.ruby-forum.com/t/can-i-use-ror-without-database/179682/4 "2009-12-02T20:28:55Z")

</div>

Vi Le wrote:

> Thanks. I just realized that rails comes with SQLite 3 support. I  
> decided to use it for now and the app works. Finally! 🙂

Yes, that should be OK to get you started. Just don’t use it for  
production. For that, I recommend PostgreSQL.

Best,  
–Â  
MarnenÂ Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![zealander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e19b73/32.png) [@zealander](https://www.ruby-forum.com/u/zealander)\
**Post date:** [December 2, 2009, 8:00pm UTC](https://www.ruby-forum.com/t/can-i-use-ror-without-database/179682/5 "2009-12-02T20:00:45Z")

</div>

Thanks. I just realized that rails comes with SQLite 3 support. I  
decided to use it for now and the app works. Finally! 🙂

---

<div class="post-metadata">

**Author:** ![zealander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e19b73/32.png) [@zealander](https://www.ruby-forum.com/u/zealander)\
**Post date:** [December 3, 2009, 7:12am UTC](https://www.ruby-forum.com/t/can-i-use-ror-without-database/179682/6 "2009-12-03T07:12:50Z")

</div>

Marnen Laibow-Koser wrote:

> Vi Le wrote:
> 
> > Thanks. I just realized that rails comes with SQLite 3 support. I  
> > decided to use it for now and the app works. Finally! 🙂
> 
> Yes, that should be OK to get you started. Just don’t use it for  
> production. For that, I recommend PostgreSQL.
> 
> Best,  
> –Â  
> MarnenÂ Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> removed\_email\_address@domain.invalid

Thanks, the production is Apache on Ubuntu and it has MySQL installed  
already.

The following question is not related to the topic but since I’m here  
I’ll just ask it:

How hard it is to push from dev to production environments if these  
environments use different web servers and databases. Considering that  
Ruby on Rails is installed on production server, would it be as easy as  
copying project files to a new location and changing database.yml? Or is  
it harder than that?

---

<div class="post-metadata">

**Author:** ![zealander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e19b73/32.png) [@zealander](https://www.ruby-forum.com/u/zealander)\
**Post date:** [December 3, 2009, 7:19am UTC](https://www.ruby-forum.com/t/can-i-use-ror-without-database/179682/7 "2009-12-03T07:19:45Z")

</div>

Vi Le wrote:  
[…]

> The following question is not related to the topic but since I’m here  
> I’ll just ask it:
> 
> How hard it is to push from dev to production environments if these  
> environments use different web servers and databases.

Not very, as long as nothing in your code depends on a particular piece  
of software.

> Considering that  
> Ruby on Rails is installed on production server, would it be as easy as  
> copying project files to a new location and changing database.yml?

Usually – and actually, one database.yml should work for all  
environments.

> Or is  
> it harder than that?

Set up Capistrano and it will be ridiculously easy.

Best,  
–Â  
MarnenÂ Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
