Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pumactl: How to specify root dir? #2243

Closed
anon987654321 opened this issue May 1, 2020 · 4 comments
Closed

pumactl: How to specify root dir? #2243

anon987654321 opened this issue May 1, 2020 · 4 comments

Comments

@anon987654321
Copy link

Is there a way to specify the root dir of my app so I don't have to cd to it first in my startup script?

Thanks!

@anon987654321
Copy link
Author

I notice puma has this option:

--dir DIR                    Change to DIR before starting

@dentarg
Copy link
Member

dentarg commented May 2, 2020

Seems like the same answer I gave in #2242 solves this too, pumactl -F app/production_config.rb start seems to work for me. I guess it gets more complicated if you are using Bundler.

Why do you want to avoid cd into your app directory?

@anon987654321
Copy link
Author

I can live with that, thanks!

Why do you want to avoid cd into your app directory?

Just for simplicity I guess. Would look a bit out of place in my startup script as well, but that's just cosmetics.

@anon987654321
Copy link
Author

Specifying the full path to the config file and having Puma automatically find everything else does not work here:

/root# pumactl --config-file /var/www/htdocs/myapp/config/puma.rb start
Puma starting in single mode...
* Version 4.3.3 (ruby 2.6.6-p146), codename: Mysterious Traveller
* Min threads: 0, max threads: 16
* Environment: production
ERROR: No application configured, nothing to run
/root# cd /var/www/htdocs/myapp
/var/www/htdocs/myapp# pumactl --config-file /var/www/htdocs/myapp/config/puma.rb start
Puma starting in single mode...
* Version 4.3.3 (ruby 2.6.6-p146), codename: Mysterious Traveller
* Min threads: 0, max threads: 16
* Environment: production
* Listening on tcp://127.0.0.1:8000
* Listening on ssl://127.0.0.1:8001?key=/etc/ssl/private/myapp.key&cert=/etc/ssl/myapp.crt
Use Ctrl-C to stop

I also tried adding dir to the config but to no avail:

undefined method `dir' for #<Puma::DSL:0x000007e3a21617e0>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants