I am struggling with puma in context of Rubymine and Rackup. I created a small app that is binding usig ssl and gets its parameter from /config/puma.rb or /config/puma/production.rb
That works fine if I start it with puma or Puma -C /config/puma.rb or puma -E production
puma starting in single mode... * Version 3.12.0 (ruby 2.4.5-p335), codename: Llamas in Pajamas * Min threads: 0, max threads: 16 * Environment: development * Listening on ssl://127.0.0.1:9001?cert=./keys/s3l.cer&key=./keys/s3l.key&verify_mode=peer&ca=./keys/sso_ca.crt Use Ctrl-C to stop
Unfortunately RubyMine IDE for sinatra apps is using a hardcoded rackup command to start the server, in addition is providing commandline parameters for IP/Port and with this puma is not really reading its config file.
In console it is consistently ignoring config file:
rackup -E production Puma starting in single mode... * Version 3.12.0 (ruby 2.4.5-p335), codename: Llamas in Pajamas * Min threads: 0, max threads: 16 * Environment: production * Listening on tcp://0.0.0.0:9292
=> wrong ip, port and no ssl!
- I tried to it with and without environment => not reading the ssl binding
- I tried to forward the -C parameter with -O C=[path] in config.ru to puma command => not reading
- I tried to avoid all this and do it in sinatra, but this is to late in "boot"
So how to I run a sinatra app with Rubymine by pressing a play button that triggers rackup? I need to execute the config file because there is my ssl binding defined... I need to use rackup because rubymine forces it. I need rubymine for debugging
At the end of it all my expectation would have been: I or rubymine IDE call rackup, it reads his config.ru, it calls puma and puma is looking for its configfile depemding on -E But puma is not looking for its file
pumar.rb
cert= "./keys/s3l.cer"
key = "./keys/s3l.key"
ca= "./keys/sso_ca.crt"
verify_mode= "peer"
bind "ssl://127.0.0.1:9001?cert=#{cert}&key=#{key}&verify_mode=#{verify_mode}&ca=#{ca}"
config.ru
hash\ -s puma -O -C=./config/pumar.rb
require 'rubygems'
require './app'
run App