From 869fb816e9fce94588e6034908be592461b26834 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Sat, 19 Sep 2015 13:16:07 -0400 Subject: [PATCH 1/2] this enables the vagrant port forwarding --- Gemfile.lock | 3 --- config/boot.rb | 8 ++++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0c82cb5a..5cec997c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -215,6 +215,3 @@ DEPENDENCIES sass-rails uglifier uservoice-ruby - -BUNDLED WITH - 1.10.6 diff --git a/config/boot.rb b/config/boot.rb index 4489e586..0f0d7c60 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,4 +1,12 @@ require 'rubygems' +require 'rails/commands/server' +module Rails + class Server + def default_options + super.merge(Host: '0.0.0.0', Port: 3000) + end + end +end # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) From f5dbfd5d720a3cfc7d560ea1a338e5eb974bf7b8 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Sat, 19 Sep 2015 13:25:30 -0400 Subject: [PATCH 2/2] configuration for production environments like heroku --- Gemfile | 1 + Gemfile.lock | 6 ++++++ config/environments/development.rb | 1 + config/environments/production.rb | 5 ++++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 7649f497..1c678383 100644 --- a/Gemfile +++ b/Gemfile @@ -35,6 +35,7 @@ end group :production do #this is used on heroku #gem 'rmagick' + gem 'rails_12factor' end group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index 5cec997c..af773f25 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -150,6 +150,11 @@ GEM loofah (~> 2.0) rails3-jquery-autocomplete (1.0.15) rails (>= 3.2) + rails_12factor (0.0.3) + rails_serve_static_assets + rails_stdout_logging + rails_serve_static_assets (0.0.4) + rails_stdout_logging (0.0.4) railties (4.2.4) actionpack (= 4.2.4) activesupport (= 4.2.4) @@ -211,6 +216,7 @@ DEPENDENCIES quiet_assets rails (= 4.2.4) rails3-jquery-autocomplete + rails_12factor redis sass-rails uglifier diff --git a/config/environments/development.rb b/config/environments/development.rb index 251e12ab..53e8b4fb 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,6 +1,7 @@ Metamaps::Application.configure do # Settings specified here will take precedence over those in config/application.rb + config.log_level = :info config.eager_load = false # In the development environment your application's code is reloaded on diff --git a/config/environments/production.rb b/config/environments/production.rb index 17773071..a515b4ca 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,6 +1,7 @@ Metamaps::Application.configure do # Settings specified here will take precedence over those in config/application.rb + config.log_level = :warn config.eager_load = true config.assets.js_compressor = :uglifier @@ -12,7 +13,9 @@ Metamaps::Application.configure do config.action_controller.perform_caching = true # Disable Rails's static asset server (Apache or nginx will already do this) - config.serve_static_assets = false + config.serve_static_files = true + + config.assets.compile = true # Compress JavaScripts and CSS config.assets.compress = true