You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When tailing the ~/Library/Log/puma-dev.log I see:
* Directory for apps: /Users/kevin/.puma-dev
* Domains: dev
* DNS Server port: 9253
* HTTP Server port: inherited from launchd
* HTTPS Server port: inherited from launchd
! Puma dev listening on http and https
! Booted app 'ksylvest' on socket /Users/kevin/.puma-dev/ksylvest/tmp/puma-dev-811.sock
Missing end to balance this if statement
fish: iftest -e Gemfile;then
^
^C⏎
Hm. Well, I explicitly ran those under the users shell to pickup things like rvm and rbenv configurations. And now I can see how that's problematic for non-bourne shells.
What do you think the best approach is for integrating the two (and maybe more) scripts? Does it make sense to move them into separate files and then modify app.go to look something like this (excuse my syntax - never written go):
I'd rather not externalize these scripts because that just becomes an installation headache. I'll go ahead and integrate your version in though. That all looks fine and the lack of else is fine because control never passes beyond the exec.
The thing I was most unsure about was if fish has source.
I explicitly ran those under the users shell to pickup things like rvm and rbenv configurations. And now I can see how that's problematic for non-bourne shells.
Really, you just want to start the server under the user’s login shell so it inherits their configured environment (PATH, etc). Once you have that parent environment, you can then explicitly spawn a new /bin/sh in which you source the rc scripts and start Puma.
I checked out your login_wrapper and puma-dev basically does that now,
which is how this bug was created.
Loading the users shell and the execing into sh is totally doable, seems
like getting PATH setup properly is the biggy for making sure the right
ruby is used.
I'll make that change shortly.
On Sun, Jul 31, 2016 at 7:11 AM Sam Stephenson [email protected]
wrote:
I explicitly ran those under the users shell to pickup things like rvm and
rbenv configurations. And now I can see how that's problematic for
non-bourne shells.
Really, you just want to start the server under the user’s login shell so
it inherits their configured environment (PATH, etc). Once you have that
parent environment, you can then explicitly spawn a new /bin/sh in which
you source the rc scripts and start Puma.
Activity
evanphx commentedon Jul 30, 2016
Hm. Well, I explicitly ran those under the users shell to pickup things like rvm and rbenv configurations. And now I can see how that's problematic for non-bourne shells.
I'd be happy to add explicit support for fish though. Could you help me write a fish version of https://github.com/puma/puma-dev/blob/master/src/puma/dev/app.go#L158-L177?
Also, do you use rvm or rbenv? If so, how do you integrate them with your shell?
ksylvest commentedon Jul 30, 2016
Didn't think of about that. I'm running on rbenv. To integrate I'm using:
For modifying the conditionals to work with fish - I think this snippet does it:
Should the last conditional need to be wrapped in an else? That is should the bash version be modified to be the following or was that intentional:
What do you think the best approach is for integrating the two (and maybe more) scripts? Does it make sense to move them into separate files and then modify app.go to look something like this (excuse my syntax - never written go):
evanphx commentedon Jul 30, 2016
I'd rather not externalize these scripts because that just becomes an installation headache. I'll go ahead and integrate your version in though. That all looks fine and the lack of else is fine because control never passes beyond the
exec.The thing I was most unsure about was if fish has
source.sstephenson commentedon Jul 31, 2016
Really, you just want to start the server under the user’s login shell so it inherits their configured environment (PATH, etc). Once you have that parent environment, you can then explicitly spawn a new
/bin/shin which you source the rc scripts and start Puma.launch_socket_server comes with a login_exec wrapper that runs a command under the user’s login shell. You could bundle or inline this in puma-dev’s launch plist.
(Related: #13)
evanphx commentedon Jul 31, 2016
I checked out your login_wrapper and puma-dev basically does that now,
which is how this bug was created.
Loading the users shell and the execing into sh is totally doable, seems
like getting PATH setup properly is the biggy for making sure the right
ruby is used.
I'll make that change shortly.
On Sun, Jul 31, 2016 at 7:11 AM Sam Stephenson [email protected]
wrote:
ksylvest commentedon Aug 1, 2016
@evanphx Thanks for the fix!