2

I am trying to run Rails development server over HTTPS using a Self-Signed SSL Certificate. But when I start the rails server using:

rails s -b "ssl://0.0.0.0:8080?key=localhost.key&cert=localhost.crt"

It is giving me following error:

C:/Ruby23/lib/ruby/gems/2.3.0/gems/puma-3.11.0/lib/puma/binder.rb:149:in `check': SSL not available in this build (StandardError)

I am using ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]

Rajkaran Mishra
  • 4,532
  • 2
  • 36
  • 61

1 Answers1

1

It's fairly difficult to use puma with SSL on RubyInstaller-2.3, since you need to install OpenSSL on you own and convince puma to link to it. Fortunately this issue is solved with RubyInstaller-2.4 and newer. You need to install OpenSSL package and install puma afterwards, so that it's built with SSL support:

ridk exec pacman -S mingw-w64-x86_64-openssl   &:: download+install OpenSSL 
gem inst puma        &:: (re-)install puma, it should find openssl libs
bundle update puma   &:: Optionally make sure the just installed puma version is used

See also related issue on rubyinstaller2: https://github.com/oneclick/rubyinstaller2/issues/81

Lars Kanis
  • 886
  • 9
  • 7