How to specify thin to use Rack adapter rather than Rails adapter when starting
-
23-10-2019 - |
Question
I am using Capistrano to deploy an app. The following command works if I enter it at the terminal via SSH:
thin start -p 20480 -e production -d
But when it is ran through Capfile like:
run "cd #{current_path} && thin start -p 20480 -e production -d"
It has this error in the log:
Writing PID to tmp/pids/thin.pid
Using rails adapter
Exiting!
/usr/local/rvm/rubies/ruby-1.8.6-p369/lib/ruby/1.8/yaml.rb:133:inload': syntax error on line 2, col 8:
specs:' (ArgumentError)
The difference is the second lin: Using rails adapter. When I enter this command at the terminal by myself, it says Using Rack adapter.
Any idea how to fix this? Thanks a lot for any suggestions.
Best regards, Tony.
Solution
Try stating explicitly whant adapter you want to use. You can do this using the --adapter switch. So your line of code will look like this:
run "cd #{current_path} && thin start -p 20480 -e production -d --adapter rack"
Maybe this helps.
PS.
thin --help says:
-A, --adapter NAME Rack adapter to use (default: autodetect)
(rack, rails, ramaze, halcyon, merb,
mack, mack, file)