Skip to content

PrivatePub does not work in production if RAILS_ENV is not set. #29

antek-drzewiecki opened this Issue Jan 23, 2012 · 32 comments


I'm new to github, rails and ruby. But before i'd make a pull request i'd like to start a discussion, to see your comments. Basically i dont know if its a real issue. When running in development mode, all goes fine. The RAILS_ENV is set to development and the private_pub gem runs fluent and the publishing and subscribing can begin.

Now in production mode if your RAILS_ENV is not set. The application will run in production mode, but your faye server will run in development experiencing "Incorrect signature." messages. Since rack does not pass the thin -E production params. A solve is to export your RAILS_ENV in the termial.
export RAILS_ENV=production
or when using bundler starting the gem with
RAILS_ENV=production bundle exec rackup -s thin -E production

I wish to commit this to the readme but i'd like to know how you guys would solve this problem.

karteek commented Feb 7, 2012

+1. Thanks a lot :-)

twetzel commented Jul 22, 2012

helps me too .. thank you


+1. Thanks.


+1. Thanks a lot. It helped me..:)


Helped thanks... :)


+1 Awesome thanks. This should be added to the README @ryanb

beno commented Feb 8, 2013

Thank you so much for unbaffling me.


+1 Lots of thanks.


+1 thanks


+1 thanks!!! to the readme plis


👍 Thanks


+1 Awesome

resure commented May 21, 2013



Thanks. must add to readme


+1 thanks.


Can you paste the output of bundle exec thin -v?


Thanks buddy, I missed thin in production :)


+1 Thanks




I stacked long time,,, This helps me a lot, thanks!!



amp343 commented Apr 13, 2014

+1 thanks!

hsamadi commented Jul 3, 2014

+1 Thanks!


Thank you! Worked for RAILS_ENV=staging too.


Hmmnnn. Tried the mention settings above and restarted my server which is Puma instead of thin but publishing and subscribing is still not working in the production environment. Same issue with @Antek-drzewiecki, everything runs smoothly on our development environment. Any help or suggestion would be appreciated.

EDIT: Ignore this. Already fixed the problem. Just a wrong config in my script. Thanks.

hsamadi commented Sep 13, 2014

I think it seems reasonable to replace ENV["RAILS_ENV"] in with ENV["RACK_ENV"] since PrivatePub is a Rack app not a Rails app. rackup only sets RACK_ENV. Thin, Webrick and Mongrel also have the same behavior.


RAILS_ENV=production bundle exec rackup -s thin -d -E production

mironov commented Apr 16, 2015

+1, thank you :)


hsamadi, thank you!


Thanks buddy. Perfect solution for me.

rili commented May 14, 2016 edited

thank you man, was almost getting crazy and giving up... that should indeed be added to Readme.

My problem was that i could not send messages in production using ssl if i started the server with the command that Ryan shows in the "Serving Faye over HTTPS (with Thin)" section without adding RAILS_ENV=production before bundle exec

So using the following didnt work for me:
thin -C config/private_pub_thin.yml start

but using this instead worked fine:
RAILS_ENV=production thin -C config/private_pub_thin.yml start


+1000 RAILS_ENV=production did the trick. I'm running the command in EC2 (both app and faye running in the same server) as following:

RAILS_ENV=production bundle exec rackup -s thin -E production -o

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.