Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jacksonpires/a9aa3359afd922497d3d110fe1020e62 to your computer and use it in GitHub Desktop.
Save jacksonpires/a9aa3359afd922497d3d110fe1020e62 to your computer and use it in GitHub Desktop.
#file bin/rails
---------------
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
# Set default host and port to rails server
if ARGV.first == 's' || ARGV.first == 'server'
require 'rails/commands/server'
module Rails
class Server
def default_options
super.merge(Host: ENV["IP"], Port: ENV["PORT"])
end
end
end
end
require 'rails/commands'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment