Last active
August 29, 2015 14:12
-
-
Save pseudomuto/ae8810b6b47fb090f8a1 to your computer and use it in GitHub Desktop.
Blog Code: Running Rails Inside Vagrant
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
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) | |
require 'bundler/setup' # Set up gems listed in the Gemfile. | |
# THIS IS THE NEW CODE | |
if ENV["RAILS_ENV"] == "development" || ENV["RAILS_ENV"].nil? | |
require "rails/commands/server" | |
module Rails | |
class Server | |
alias_method :original_default_options, :default_options | |
def default_options | |
original_default_options.merge(Host: "0.0.0.0") | |
end | |
end | |
end | |
end |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANT_IP = '192.168.211.39' | |
Vagrant.configure("2") do |config| | |
config.vm.box = ... | |
config.vm.box_url = ... | |
config.vm.network :private_network, ip: VAGRANT_IP | |
... | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment