How can I run a Rack-based application (not Rails) with unicorn? Let’s assume I have a “hello world” response simple rack app with the name of server.ru, and config file at the same directory with the name of unicorn.conf, how am I supposed to run it? In Thin, for example, I would do something like:
bundle exec rackup server.ru -s thin -E production -p 4001
How would I do the same to run under Unicorn?
Unicorn does not give any special treatment to Rails 3+ applications, so the behavior is exactly the same for Rails 3+ applications and non-Rails Rack applications. Just run
in your app’s root. To run with a specific port, pass
-p/--portwith the port:You can also specify the rackup file:
You can see all the options by running
unicorn --help. Of course, you should prependbundle execto these commands as needed by your setup.