From f31b8a7718776c1334222287dd5cb4ce31dadab3 Mon Sep 17 00:00:00 2001 From: Tucq Date: Tue, 25 Oct 2016 03:25:20 +0000 Subject: [PATCH 1/5] Add tether gem + update bootstrap --- Gemfile | 6 +++++- Gemfile.lock | 12 +++++++----- app/assets/javascripts/application.js | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 7c2b2f9..be215a5 100644 --- a/Gemfile +++ b/Gemfile @@ -26,7 +26,11 @@ gem 'sdoc', '~> 0.4.0', group: :doc # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' -gem 'bootstrap', '~> 4.0.0.alpha1' +source 'https://rails-assets.org' do + gem 'rails-assets-tether', '>= 1.1.0' +end + +gem 'bootstrap', '~> 4.0.0.alpha5' gem 'simple_form' gem 'quiet_assets' gem 'better_errors', group: :development diff --git a/Gemfile.lock b/Gemfile.lock index 48ac907..130cc87 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,5 +1,6 @@ GEM remote: https://rubygems.org/ + remote: https://rails-assets.org/ specs: actionmailer (4.2.5) actionpack (= 4.2.5) @@ -37,16 +38,15 @@ GEM thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) arel (6.0.3) - autoprefixer-rails (6.1.2) + autoprefixer-rails (6.5.1.1) execjs - json better_errors (2.1.1) coderay (>= 1.0.0) erubis (>= 2.6.6) rack (>= 0.9.0) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - bootstrap (4.0.0.alpha2) + bootstrap (4.0.0.alpha5) autoprefixer-rails (>= 6.0.3) sass (>= 3.4.19) builder (3.2.2) @@ -105,6 +105,7 @@ GEM bundler (>= 1.3.0, < 2.0) railties (= 4.2.5) sprockets-rails + rails-assets-tether (1.3.7) rails-deprecated_sanitizer (1.0.3) activesupport (>= 4.2.0.alpha) rails-dom-testing (1.0.7) @@ -162,7 +163,7 @@ PLATFORMS DEPENDENCIES better_errors - bootstrap (~> 4.0.0.alpha1) + bootstrap (~> 4.0.0.alpha5) byebug coffee-rails (~> 4.1.0) font-awesome-rails @@ -172,6 +173,7 @@ DEPENDENCIES pg quiet_assets rails (= 4.2.5) + rails-assets-tether (>= 1.1.0)! sass-rails (~> 5.0) sdoc (~> 0.4.0) simple_form @@ -181,4 +183,4 @@ DEPENDENCIES web-console (~> 2.0) BUNDLED WITH - 1.11.2 + 1.13.5 diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index f0abf5e..d26a9d5 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,6 +12,7 @@ // //= require jquery //= require jquery_ujs +//= require tether //= require bootstrap-sprockets //= require turbolinks //= require_tree . From dd7e417f54ee6af961a3efd0c94a1646a20feb61 Mon Sep 17 00:00:00 2001 From: Tucq Date: Tue, 25 Oct 2016 03:25:33 +0000 Subject: [PATCH 2/5] Tweak settings for Vagrantbox + debug --- config/boot.rb | 11 +++++++++++ config/environments/development.rb | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/config/boot.rb b/config/boot.rb index 6b750f0..7bf160a 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,14 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) require 'bundler/setup' # Set up gems listed in the Gemfile. + +# Custom for rails server +require 'rails/commands/server' +module Rails + class Server + alias :default_options_bk :default_options + def default_options + default_options_bk.merge!(Host: '0.0.0.0') + end + end +end \ No newline at end of file diff --git a/config/environments/development.rb b/config/environments/development.rb index b55e214..d845d39 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -38,4 +38,9 @@ # Raises error for missing translations # config.action_view.raise_on_missing_translations = true + # + + # For Vagrant box + config.web_console.whitelisted_ips = '0.0.0.0/0' + config.web_console.whiny_requests = false end From de4dcaf5b59eedc2e5ae8e7c47acf0981fc81648 Mon Sep 17 00:00:00 2001 From: Tucq Date: Tue, 25 Oct 2016 03:33:51 +0000 Subject: [PATCH 3/5] Update to use Rails 5 and corresponding gems --- Gemfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index be215a5..fbef83b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,12 @@ source 'https://rubygems.org' - +ruby '2.3.1' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '4.2.5' +gem 'rails', '~> 5.0.0', '>= 5.0.0.1' # Use pg as the database for Active Record -gem 'pg' +gem 'pg', '~> 0.18' +# Use Puma as the app server +gem 'puma', '~> 3.0' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets @@ -17,9 +19,9 @@ gem 'coffee-rails', '~> 4.1.0' # Use jquery as the JavaScript library gem 'jquery-rails' # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks -gem 'turbolinks' +gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder -gem 'jbuilder', '~> 2.0' +gem 'jbuilder', '~> 2.5' # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', '~> 0.4.0', group: :doc @@ -50,7 +52,7 @@ end group :development do # Access an IRB console on exception pages or by using <%= console %> in views - gem 'web-console', '~> 2.0' + gem 'web-console' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' From 6bb5d41db956035c20e9ef6c10e9c158cf5a77ba Mon Sep 17 00:00:00 2001 From: Tucq Date: Tue, 25 Oct 2016 03:42:01 +0000 Subject: [PATCH 4/5] Update to use Rails 5 and corresponding gems --- Gemfile | 15 ++-- Gemfile.lock | 222 +++++++++++++++++++++++++++------------------------ 2 files changed, 124 insertions(+), 113 deletions(-) diff --git a/Gemfile b/Gemfile index be215a5..b6f24c9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,12 @@ source 'https://rubygems.org' - +ruby '2.3.1' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '4.2.5' +gem 'rails', '~> 5.0.0', '>= 5.0.0.1' # Use pg as the database for Active Record -gem 'pg' +gem 'pg', '~> 0.18' +# Use Puma as the app server +gem 'puma', '~> 3.0' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets @@ -17,9 +19,9 @@ gem 'coffee-rails', '~> 4.1.0' # Use jquery as the JavaScript library gem 'jquery-rails' # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks -gem 'turbolinks' +gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder -gem 'jbuilder', '~> 2.0' +gem 'jbuilder', '~> 2.5' # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', '~> 0.4.0', group: :doc @@ -32,7 +34,6 @@ end gem 'bootstrap', '~> 4.0.0.alpha5' gem 'simple_form' -gem 'quiet_assets' gem 'better_errors', group: :development gem 'font-awesome-rails' gem 'font-kit-rails', '~> 1.2.0' @@ -50,7 +51,7 @@ end group :development do # Access an IRB console on exception pages or by using <%= console %> in views - gem 'web-console', '~> 2.0' + gem 'web-console' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' diff --git a/Gemfile.lock b/Gemfile.lock index 130cc87..4b44fd2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,161 +2,168 @@ GEM remote: https://rubygems.org/ remote: https://rails-assets.org/ specs: - actionmailer (4.2.5) - actionpack (= 4.2.5) - actionview (= 4.2.5) - activejob (= 4.2.5) + actioncable (5.0.0.1) + actionpack (= 5.0.0.1) + nio4r (~> 1.2) + websocket-driver (~> 0.6.1) + actionmailer (5.0.0.1) + actionpack (= 5.0.0.1) + actionview (= 5.0.0.1) + activejob (= 5.0.0.1) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.5) - actionview (= 4.2.5) - activesupport (= 4.2.5) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) + rails-dom-testing (~> 2.0) + actionpack (5.0.0.1) + actionview (= 5.0.0.1) + activesupport (= 5.0.0.1) + rack (~> 2.0) + rack-test (~> 0.6.3) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.5) - activesupport (= 4.2.5) + actionview (5.0.0.1) + activesupport (= 5.0.0.1) builder (~> 3.1) erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - activejob (4.2.5) - activesupport (= 4.2.5) - globalid (>= 0.3.0) - activemodel (4.2.5) - activesupport (= 4.2.5) - builder (~> 3.1) - activerecord (4.2.5) - activemodel (= 4.2.5) - activesupport (= 4.2.5) - arel (~> 6.0) - activesupport (4.2.5) + activejob (5.0.0.1) + activesupport (= 5.0.0.1) + globalid (>= 0.3.6) + activemodel (5.0.0.1) + activesupport (= 5.0.0.1) + activerecord (5.0.0.1) + activemodel (= 5.0.0.1) + activesupport (= 5.0.0.1) + arel (~> 7.0) + activesupport (5.0.0.1) + concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - arel (6.0.3) + arel (7.1.4) autoprefixer-rails (6.5.1.1) execjs better_errors (2.1.1) coderay (>= 1.0.0) erubis (>= 2.6.6) rack (>= 0.9.0) - binding_of_caller (0.7.2) - debug_inspector (>= 0.0.1) bootstrap (4.0.0.alpha5) autoprefixer-rails (>= 6.0.3) sass (>= 3.4.19) builder (3.2.2) - byebug (8.2.1) - coderay (1.1.0) - coffee-rails (4.1.0) + byebug (9.0.6) + coderay (1.1.1) + coffee-rails (4.1.1) coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.0) + railties (>= 4.0.0, < 5.1.x) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.10.0) - concurrent-ruby (1.0.0) + concurrent-ruby (1.0.2) debug_inspector (0.0.2) erubis (2.7.0) - execjs (2.6.0) - font-awesome-rails (4.5.0.0) - railties (>= 3.2, < 5.0) + execjs (2.7.0) + font-awesome-rails (4.7.0.0) + railties (>= 3.2, < 5.1) font-kit-rails (1.2.0) rails - globalid (0.3.6) + globalid (0.3.7) activesupport (>= 4.1.0) i18n (0.7.0) - jbuilder (2.3.2) - activesupport (>= 3.0.0, < 5) + jbuilder (2.6.0) + activesupport (>= 3.0.0, < 5.1) multi_json (~> 1.2) - jquery-rails (4.0.5) - rails-dom-testing (~> 1.0) + jquery-rails (4.2.1) + rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (1.8.3) loofah (2.0.3) nokogiri (>= 1.5.9) - mail (2.6.3) - mime-types (>= 1.16, < 3) - mime-types (2.99) - mini_portile2 (2.0.0) - minitest (5.8.3) - multi_json (1.11.2) - nokogiri (1.6.7) - mini_portile2 (~> 2.0.0.rc2) - pg (0.18.4) - quiet_assets (1.1.0) - railties (>= 3.1, < 5.0) - rack (1.6.4) + mail (2.6.4) + mime-types (>= 1.16, < 4) + method_source (0.8.2) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) + mini_portile2 (2.1.0) + minitest (5.9.1) + multi_json (1.12.1) + nio4r (1.2.1) + nokogiri (1.6.8.1) + mini_portile2 (~> 2.1.0) + pg (0.19.0) + puma (3.6.0) + rack (2.0.1) rack-test (0.6.3) rack (>= 1.0) - rails (4.2.5) - actionmailer (= 4.2.5) - actionpack (= 4.2.5) - actionview (= 4.2.5) - activejob (= 4.2.5) - activemodel (= 4.2.5) - activerecord (= 4.2.5) - activesupport (= 4.2.5) + rails (5.0.0.1) + actioncable (= 5.0.0.1) + actionmailer (= 5.0.0.1) + actionpack (= 5.0.0.1) + actionview (= 5.0.0.1) + activejob (= 5.0.0.1) + activemodel (= 5.0.0.1) + activerecord (= 5.0.0.1) + activesupport (= 5.0.0.1) bundler (>= 1.3.0, < 2.0) - railties (= 4.2.5) - sprockets-rails + railties (= 5.0.0.1) + sprockets-rails (>= 2.0.0) rails-assets-tether (1.3.7) - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.7) - activesupport (>= 4.2.0.beta, < 5.0) + rails-dom-testing (2.0.1) + activesupport (>= 4.2.0, < 6.0) nokogiri (~> 1.6.0) - rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.0.2) + rails-html-sanitizer (1.0.3) loofah (~> 2.0) - railties (4.2.5) - actionpack (= 4.2.5) - activesupport (= 4.2.5) + railties (5.0.0.1) + actionpack (= 5.0.0.1) + activesupport (= 5.0.0.1) + method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (10.4.2) - rdoc (4.2.0) - sass (3.4.19) - sass-rails (5.0.4) - railties (>= 4.0.0, < 5.0) + rake (11.3.0) + rdoc (4.2.2) + json (~> 1.4) + sass (3.4.22) + sass-rails (5.0.6) + railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - sdoc (0.4.1) + sdoc (0.4.2) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) - simple_form (3.2.0) - actionpack (~> 4.0) - activemodel (~> 4.0) - spring (1.5.0) - sprockets (3.5.1) + simple_form (3.3.1) + actionpack (> 4, < 5.1) + activemodel (> 4, < 5.1) + spring (2.0.0) + activesupport (>= 4.2) + sprockets (3.7.0) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (2.3.3) - actionpack (>= 3.0) - activesupport (>= 3.0) - sprockets (>= 2.8, < 4.0) + sprockets-rails (3.2.0) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) thor (0.19.1) thread_safe (0.3.5) - tilt (2.0.1) - turbolinks (2.5.3) - coffee-rails + tilt (2.0.5) + turbolinks (5.0.1) + turbolinks-source (~> 5) + turbolinks-source (5.0.0) tzinfo (1.2.2) thread_safe (~> 0.1) - uglifier (2.7.2) - execjs (>= 0.3.0) - json (>= 1.8.0) - web-console (2.2.1) - activemodel (>= 4.0) - binding_of_caller (>= 0.7.2) - railties (>= 4.0) - sprockets-rails (>= 2.0, < 4.0) + uglifier (3.0.3) + execjs (>= 0.3.0, < 3) + web-console (3.3.1) + actionview (>= 5.0) + activemodel (>= 5.0) + debug_inspector + railties (>= 5.0) + websocket-driver (0.6.4) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) PLATFORMS ruby @@ -168,19 +175,22 @@ DEPENDENCIES coffee-rails (~> 4.1.0) font-awesome-rails font-kit-rails (~> 1.2.0) - jbuilder (~> 2.0) + jbuilder (~> 2.5) jquery-rails - pg - quiet_assets - rails (= 4.2.5) + pg (~> 0.18) + puma (~> 3.0) + rails (~> 5.0.0, >= 5.0.0.1) rails-assets-tether (>= 1.1.0)! sass-rails (~> 5.0) sdoc (~> 0.4.0) simple_form spring - turbolinks + turbolinks (~> 5) uglifier (>= 1.3.0) - web-console (~> 2.0) + web-console + +RUBY VERSION + ruby 2.3.1p112 BUNDLED WITH 1.13.5 From a8f97eb7901ba61faaed518bc089c7cff98f2156 Mon Sep 17 00:00:00 2001 From: Tucq Date: Tue, 25 Oct 2016 10:47:16 +0700 Subject: [PATCH 5/5] Update replicated config for production --- config/environments/production.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 5c1b32e..f18d0d9 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -22,7 +22,8 @@ # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. - config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? + # config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? # DEPRICATED + config.public_file_server.enabled = true # Compress JavaScripts and CSS. config.assets.js_compressor = :uglifier