# No commands working in Production

**URL:** <https://www.ruby-forum.com/t/no-commands-working-in-production/234593>\
**Category:** Rails\
**Created:** [March 16, 2015, 5:48pm UTC](https://www.ruby-forum.com/t/no-commands-working-in-production/234593 "2015-03-16T17:48:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [March 16, 2015, 5:48pm UTC](https://www.ruby-forum.com/t/no-commands-working-in-production/234593/1 "2015-03-16T17:48:06Z")

</div>

I’m having an issue getting my app to start up in production. After  
spending a lot of time trying to troubleshoot differences between  
production and development servers, I set up a clean Ubuntu 14.04 server  
on  
EC2. Everything runs fine in the development environment, but as soon  
as I  
try to do anything in the production environment, it fails immediately  
with  
no errors and no logs (that I can find). See below for what I’m getting  
on  
the command line when trying to start the server or create the database.

_Starting server in Development:_

ubuntu@ip-172-31-27-6:~/myapp$ rails s puma -b  
[ec2-54-173-179-250.compute-1.amazonaws.com](http://ec2-54-173-179-250.compute-1.amazonaws.com)  
=\> Booting Puma  
=\> Rails 4.2.0 application starting in development on  
[http://ec2-54-173-179-250.compute-1.amazonaws.com:3000](http://ec2-54-173-179-250.compute-1.amazonaws.com:3000)  
=\> Run `rails server -h` for more startup options  
=\> Ctrl-C to shutdown server  
Puma 2.11.1 starting…

- Min threads: 0, max threads: 16
- Environment: development
- Listening on tcp://ec2-54-173-179-250.compute-1.amazonaws.com:3000

\*Starting server in \*_Production:_

ubuntu@ip-172-31-27-6:~/myapp$ rails s puma -b  
[ec2-54-173-179-250.compute-1.amazonaws.com](http://ec2-54-173-179-250.compute-1.amazonaws.com) -e production  
=\> Booting Puma  
=\> Rails 4.2.0 application starting in production on  
[http://ec2-54-173-179-250.compute-1.amazonaws.com:3000](http://ec2-54-173-179-250.compute-1.amazonaws.com:3000)  
=\> Run `rails server -h` for more startup options  
=\> Ctrl-C to shutdown server  
Abort testing: Your Rails environment is running in production mode!  
Exiting  
ubuntu@ip-172-31-27-6:~/myapp$

_Creating DB in Development_

ubuntu@ip-172-31-27-6:~/myapp$ RAILS\_ENV=development rake db:create  
db:schema:load  
– enable\_extension(“plpgsql”)  
 → 0.0241s  
– create\_table(“clients”, {:force=\>:cascade})  
 → 0.0195s  
– add\_index(“clients”, [“user\_id”], {:name=\>“index\_clients\_on\_user\_id”,  
:using=\>:btree})  
 → 0.0071s  
– create\_table(“pieces”, {:force=\>:cascade})  
 → 0.0134s  
– add\_index(“pieces”, [“user\_id”], {:name=\>“index\_pieces\_on\_user\_id”,  
:using=\>:btree})  
 → 0.0075s  
– create\_table(“rentals”, {:force=\>:cascade})  
 → 0.0065s  
– add\_index(“rentals”, [“client\_id”],  
{:name=\>“index\_rentals\_on\_client\_id”, :using=\>:btree})  
 → 0.0063s  
– add\_index(“rentals”, [“piece\_id”],  
{:name=\>“index\_rentals\_on\_piece\_id”,  
:using=\>:btree})  
 → 0.0065s  
– create\_table(“users”, {:force=\>:cascade})  
 → 0.0111s  
– add\_index(“users”, [“email”], {:name=\>“index\_users\_on\_email”,  
:unique=\>true, :using=\>:btree})  
 → 0.0057s  
– add\_foreign\_key(“clients”, “users”)  
 → 0.0032s  
– add\_foreign\_key(“pieces”, “users”)  
 → 0.0020s  
– initialize\_schema\_migrations\_table()  
 → 0.0140s  
Started

0/0:  
[==================================================================================================]  
100% Time: 00:00:00, Time: 00:00:00

_Creating DB in Production:_

ubuntu@ip-172-31-27-6:~/myapp$ RAILS\_ENV=production rake db:create  
db:schema:load  
Abort testing: Your Rails environment is running in production mode!  
ubuntu@ip-172-31-27-6:~/myapp$

In this case, the production database is created, but the tables aren’t.

Basically, running any command seems to stop after getting the message  
“Abort testing: Your Rails environment is running in production mode!”  
I’ve tried pointing to the already-created dev database in database.yml  
and running the server, but I get the same problem. I’ve tried using  
WEBrick, puma and unicorn. All end up with the same issue. I even  
copied  
environments/development.rb to environments/production.rb, with no luck.

I’m new to RoR and this kind of development environment. I don’t even  
know  
where to begin troubleshooting this, so any help would be appreciated.

Thanks  
Mark

---

<div class="post-metadata">

**Author:** ![Mark\_Sandford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6de8d8/32.png) [@Mark\_Sandford](https://www.ruby-forum.com/u/Mark_Sandford)\
**Post date:** [March 16, 2015, 5:58pm UTC](https://www.ruby-forum.com/t/no-commands-working-in-production/234593/2 "2015-03-16T17:58:18Z")

</div>

On Monday, March 16, 2015 at 4:47:12 PM UTC, Mark Sandford wrote:

> I’m having an issue getting my app to start up in production. After  
> spending a lot of time trying to troubleshoot differences between  
> production and development servers, I set up a clean Ubuntu 14.04 server on  
> EC2. Everything runs fine in the development environment, but as soon as I  
> try to do anything in the production environment, it fails immediately with  
> no errors and no logs (that I can find). See below for what I’m getting on  
> the command line when trying to start the server or create the database.
> 
> Looks like someone was very paranoid about running in production mode -  
> I’d search the code base for instances of that warning message. It seems  
> that by default this is included in test\_help.rb (generated as part of a  
> rails app), so it’s possible that’s been required somehow.

Fred

---

<div class="post-metadata">

**Author:** ![Mark\_Sandford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6de8d8/32.png) [@Mark\_Sandford](https://www.ruby-forum.com/u/Mark_Sandford)\
**Post date:** [March 16, 2015, 6:51pm UTC](https://www.ruby-forum.com/t/no-commands-working-in-production/234593/3 "2015-03-16T18:51:17Z")

</div>

You, sir, are a giant among men.

I assumed the message about running in production was a standard message  
whenever running in that environment. Commenting out “require  
‘rails/test\_help’” in environment.rb did the trick.

Thanks!

Mark
