ryanb / letter_opener

Preview mail in the browser instead of sending.
MIT License
3.73k stars 237 forks source link

support for nginx in development #134

Closed railsfactory-madhusudhan closed 6 years ago

railsfactory-madhusudhan commented 7 years ago

letter opener not opening in browser in Nginx in development environment, if I run on webrick it is opening mail on browser. I have many applications that interchange data, so I have nginx running rather than running each app on different ports in webrick. Question is, will letter opener support in nginx server in development environment?

I am running on Ubuntu 14.04. ruby - 2.3.1 rails - 4.2.5.1 letter_opener - 1.2.0

In Mac it is working fine with nginx server.

railsfactory-madhusudhan commented 7 years ago

More info from gem on how it looks like

cmd = #<Launchy::Argv:0x007f7e726a7690 @argv=["xdg-open"]> args = [["file:////home/username/projects/simple_app/tmp/letter_opener/1479896686_41ee911/rich.html"]]

shell_commands( cmd, *args ) = ["xdg-open", "file:////home/username/projects/simple_app/tmp/letter_opener/1479896686_41ee911/rich.html"]

When this line executes exec( shell_commands( cmd, args )) it does nothing and it doesn't complete the call, then the process is detached. Is there anything nginx is holding up?

nashby commented 7 years ago

@railsfactory-madhusudhan did you try to run xdg-open from console yourself?

railsfactory-madhusudhan commented 7 years ago

@nashby yes I tried and it opened from console. I tried with demo app with webrick server and it's working fine, only change here is I'm using nginx server for development environment.

nashby commented 6 years ago

@railsfactory-madhusudhan hey, have you figured that out?