# Has anybody succeed in getting Rails 3 to work in production?

**URL:** <https://www.ruby-forum.com/t/has-anybody-succeed-in-getting-rails-3-to-work-in-production/187563>\
**Category:** Rails\
**Created:** [April 25, 2010, 11:47pm UTC](https://www.ruby-forum.com/t/has-anybody-succeed-in-getting-rails-3-to-work-in-production/187563 "2010-04-25T23:47:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptremblett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Post date:** [April 25, 2010, 11:47pm UTC](https://www.ruby-forum.com/t/has-anybody-succeed-in-getting-rails-3-to-work-in-production/187563/1 "2010-04-25T23:47:12Z")

</div>

Has anybody succeed in getting Rails 3 to work in production? I am  
trying with Apache 2.2 and Passenger 2.2.12 but no luck. If you have  
got Rails three to work in production on any server with any set up  
could you please post the details (howto?) or a link to where such  
information can be found.

All input gratefully received.

Paul Thompson

---

<div class="post-metadata">

**Author:** ![ptremblett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Post date:** [April 26, 2010, 12:55am UTC](https://www.ruby-forum.com/t/has-anybody-succeed-in-getting-rails-3-to-work-in-production/187563/2 "2010-04-26T00:55:40Z")

</div>

Hi Paul,

I’m running a test server in production environment with nginx as  
front-end, ruby-1.9.1-p378 and one mongrel in the backend.  
The script I’m currently using to start the application is as  
following:

#!/bin/sh

export RAILS\_ENV=production

# kill old server if running

if [-f /home/csb/apps/ric/current/log/rackup.pid]; then  
echo “Stopping old server instance…”  
kill `cat /home/csb/apps/ric/current/log/rackup.pid`  
sleep 2;  
fi

# startup new server

echo “Starting new server instance…”  
cd /home/csb/apps/ric/current  
rackup -D -E production -p 8010 -P /home/csb/apps/ric/current/log/  
rackup.pid /home/csb/apps/ric/current/config.ru

echo “DONE”

the export RAILS\_ENV is needed because rackup seems to ignore the -E  
option also I had to modify the server.rb file in the rack gem to keep  
the application running in the background  
I had to change the code to:

```
  if options[:daemonize]
    app.inspect
    daemonize_app
  end

```

where it used to be:

```
  daemonize_app if [:daemonize]

```

otherwise the process will just terminate if you call rackup -D I  
opened an entry on the rack google group but never got any feedback.  
You can find it here:  
[http://groups.google.com/group/rack-devel/browse\_thread/thread/db945afbffe5a0fc/29ca4400c6389a11](http://groups.google.com/group/rack-devel/browse_thread/thread/db945afbffe5a0fc/29ca4400c6389a11)

Best, Daniel
