Last active
November 7, 2017 00:21
-
-
Save cpappen/9018d4d87f5175e548cc286bd3a4f640 to your computer and use it in GitHub Desktop.
binding ip 0.0.0.0 on rails 4.2.1 app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#config/boot.rb | |
require 'rails/commands/server' | |
module Rails | |
class Server | |
new_defaults = Module.new do | |
def default_options | |
default_host = Rails.env == 'development' ? '0.0.0.0' : '127.0.0.1' | |
super.merge( Host: default_host ) | |
end | |
end | |
# Note: Module#prepend requires Ruby 2.0 or later | |
prepend new_defaults | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment