ryanb / private_pub

Handle pub/sub messaging through private channels in Rails using Faye.
MIT License
864 stars 228 forks source link

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

Open antek-drzewiecki opened 12 years ago

antek-drzewiecki commented 12 years ago

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.

karteek commented 12 years ago

+1. Thanks a lot :-)

twetzel commented 12 years ago

helps me too .. thank you

dallasread commented 11 years ago

+1. Thanks.

aman199002 commented 11 years ago

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

naveenagarwal commented 11 years ago

Helped thanks... :)

seanarnold commented 11 years ago

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

beno commented 11 years ago

Thank you so much for unbaffling me.

tommyalvarez commented 11 years ago

+1 Lots of thanks.

ShiningRay commented 11 years ago

+1 thanks

jdsampayo commented 11 years ago

+1 thanks!!! to the readme plis

pSenthil202 commented 11 years ago

:+1: Thanks

JHanley85 commented 11 years ago

+1 Awesome

resure commented 11 years ago

Thanks!

kabdelhady commented 11 years ago

Thanks. must add to readme

jakejuby commented 11 years ago

+1 thanks.

gregmolnar commented 10 years ago

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

manoj2411 commented 10 years ago

Thanks buddy, I missed thin in production :)

LeandroFigueredo commented 10 years ago

+1 Thanks

rogeliog commented 10 years ago

+1

mazeltov7 commented 10 years ago

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

deepredsky commented 10 years ago

+1

amp343 commented 10 years ago

+1 thanks!

hsamadi commented 10 years ago

+1 Thanks!

vladimir-e commented 10 years ago

Thank you! Worked for RAILS_ENV=staging too.

x44x45x41x4E commented 10 years ago

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 9 years ago

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.

yigitbacakoglu commented 9 years ago

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

mironov commented 9 years ago

+1, thank you :)

guilhermeap commented 8 years ago

hsamadi, thank you!

harshad26 commented 8 years ago

Thanks buddy. Perfect solution for me.

rili commented 8 years ago

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

porta8080 commented 8 years ago

+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