# Why code works in development and not production

**URL:** <https://www.ruby-forum.com/t/why-code-works-in-development-and-not-production/139541>\
**Category:** Rails\
**Created:** [June 4, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/why-code-works-in-development-and-not-production/139541 "2008-06-04T20:41:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@amanda](https://www.ruby-forum.com/u/amanda)\
**Post date:** [June 4, 2008, 8:41pm UTC](https://www.ruby-forum.com/t/why-code-works-in-development-and-not-production/139541/1 "2008-06-04T20:41:27Z")

</div>

I’ve had a few problems with my site working perfectly in development  
then in production not doing what it’s supposed to or having errors.  
I’ve tried to find information about why these things could happen but  
haven’t had any luck. Does anybody know anything about why a site would  
work one way in development then incorrectly (or not at all) in  
production. Any ideas or links to where I can read more about this  
would be great.

Thanks

---

<div class="post-metadata">

**Author:** ![amanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@amanda](https://www.ruby-forum.com/u/amanda)\
**Post date:** [June 4, 2008, 9:02pm UTC](https://www.ruby-forum.com/t/why-code-works-in-development-and-not-production/139541/2 "2008-06-04T21:02:02Z")

</div>

A number of things need to change when an app goes into production. I  
assume you’ve adjusted the environment.rb from development to  
production, made sure your routes.rb file is still correct, adjuested  
your database.yml file from development to production (these files are  
all in the Config folder), as well as removed the index.html in the  
Public folder and dropped your CSS file, assuming you have one, in  
your Stylesheets folder in the Public folder.

At least that’s where I would look to see if anything is off.

On Jun 4, 1:41 pm, “Amanda …” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![amanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@amanda](https://www.ruby-forum.com/u/amanda)\
**Post date:** [June 4, 2008, 9:06pm UTC](https://www.ruby-forum.com/t/why-code-works-in-development-and-not-production/139541/3 "2008-06-04T21:06:46Z")

</div>

Amanda … wrote:

> I’ve had a few problems with my site working perfectly in development  
> then in production not doing what it’s supposed to or having errors.  
> I’ve tried to find information about why these things could happen but  
> haven’t had any luck. Does anybody know anything about why a site would  
> work one way in development then incorrectly (or not at all) in  
> production. Any ideas or links to where I can read more about this  
> would be great.

How well does it work in test mode?

---

<div class="post-metadata">

**Author:** ![amanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@amanda](https://www.ruby-forum.com/u/amanda)\
**Post date:** [June 4, 2008, 9:30pm UTC](https://www.ruby-forum.com/t/why-code-works-in-development-and-not-production/139541/4 "2008-06-04T21:30:35Z")

</div>

Phlip wrote:

> How well does it work in test mode?

… I don’t know how to get it into test mode ☹

---

<div class="post-metadata">

**Author:** ![amanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@amanda](https://www.ruby-forum.com/u/amanda)\
**Post date:** [June 4, 2008, 9:07pm UTC](https://www.ruby-forum.com/t/why-code-works-in-development-and-not-production/139541/5 "2008-06-04T21:07:58Z")

</div>

If you have all the gems and configuration set, most of the time it’s  
how Rails doesn’t reload stuff like it does in development. Look at  
your config/environments/development.rb and play around with those  
settings to make it look like production. Then, slowly change em back  
to how they were in development and see what works and doesn’t.

On Thu, Jun 5, 2008 at 2:41 AM, Amanda …  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
Ramon T.
