Skip to content

Instantly share code, notes, and snippets.

@lukemorton
Created October 2, 2015 08:53
Show Gist options
  • Save lukemorton/e443c93df22ec7669a70 to your computer and use it in GitHub Desktop.
Save lukemorton/e443c93df22ec7669a70 to your computer and use it in GitHub Desktop.
For rails 4.2 projects served from inside vagrant
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
# Override default IP binding so that we can work inside vagrant!!
#
require 'rails/commands/server'
module Rails
class Server
alias :default_options_alias :default_options
def default_options
default_options_alias.merge!(:Host => '0.0.0.0')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment