private_pub icon indicating copy to clipboard operation
private_pub copied to clipboard

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

Open antek-drzewiecki opened this issue 12 years ago • 32 comments

Hello,

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 private_pub.ru -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.

antek-drzewiecki avatar Jan 23 '12 21:01 antek-drzewiecki

+1. Thanks a lot :-)

karteek avatar Feb 07 '12 14:02 karteek

helps me too .. thank you

twetzel avatar Jul 22 '12 00:07 twetzel

+1. Thanks.

dallasread avatar Sep 29 '12 02:09 dallasread

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

aman199002 avatar Dec 12 '12 13:12 aman199002

Helped thanks... :)

naveenagarwal avatar Dec 17 '12 12:12 naveenagarwal

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

seanarnold avatar Jan 18 '13 01:01 seanarnold

Thank you so much for unbaffling me.

beno avatar Feb 08 '13 13:02 beno

+1 Lots of thanks.

tommyalvarez avatar Mar 17 '13 23:03 tommyalvarez

+1 thanks

ShiningRay avatar Mar 28 '13 09:03 ShiningRay

+1 thanks!!! to the readme plis

jdsampayo avatar Apr 08 '13 23:04 jdsampayo

:+1: Thanks

pSenthil202 avatar Apr 10 '13 13:04 pSenthil202

+1 Awesome

JHanley85 avatar May 18 '13 11:05 JHanley85

Thanks!

resure avatar May 21 '13 21:05 resure

Thanks. must add to readme

kabdelhady avatar May 29 '13 09:05 kabdelhady

+1 thanks.

jakejuby avatar Jun 14 '13 14:06 jakejuby

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

gregmolnar avatar Sep 30 '13 15:09 gregmolnar

Thanks buddy, I missed thin in production :)

manoj2411 avatar Sep 30 '13 17:09 manoj2411

+1 Thanks

LeandroFigueredo avatar Nov 01 '13 18:11 LeandroFigueredo

+1

rogeliog avatar Jan 16 '14 20:01 rogeliog

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

mazeltov7 avatar Jan 24 '14 18:01 mazeltov7

+1

deepredsky avatar Apr 01 '14 21:04 deepredsky

+1 thanks!

amp343 avatar Apr 13 '14 07:04 amp343

+1 Thanks!

hsamadi avatar Jul 03 '14 07:07 hsamadi

Thank you! Worked for RAILS_ENV=staging too.

vladimir-e avatar Jul 11 '14 10:07 vladimir-e

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.

x44x45x41x4E avatar Jul 11 '14 18:07 x44x45x41x4E

I think it seems reasonable to replace ENV["RAILS_ENV"] in private_pub.ru 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.

hsamadi avatar Sep 13 '14 15:09 hsamadi

+1 RAILS_ENV=production bundle exec rackup private_pub.ru -s thin -d -E production

yigitbacakoglu avatar Sep 20 '14 10:09 yigitbacakoglu

+1, thank you :)

mironov avatar Apr 16 '15 20:04 mironov

hsamadi, thank you!

guilhermeap avatar Aug 06 '15 14:08 guilhermeap

Thanks buddy. Perfect solution for me.

harshad26 avatar Apr 09 '16 09:04 harshad26

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

rili avatar May 14 '16 10:05 rili

+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 private_pub.ru -s thin -E production -o 0.0.0.0

porta8080 avatar May 23 '16 13:05 porta8080