TL;DR
Create a backup:
pg_dumpall > mybackup.sql
Perform the upgrade:
sudo pg_dropcluster 9.4 main --stop
#!/usr/bin/env ruby | |
def changelog_for_gem(gem) | |
changelogs = `bundle exec gem contents #{gem}`.lines.grep(/history|changelog|news/i) | |
if changelogs.empty? | |
puts "No changelog found for gem #{gem}" | |
return nil | |
end |
# Capistrano Laravel 4 Deployment Tasks | |
# Watts Martin (layotl at gmail com) | |
# https://gist.github.com/chipotle/5506641 | |
# updated 14-Aug-2013 | |
# Assumptions: | |
# | |
# - You are using a .gitignore similar to Laravel's default, so your | |
# vendor directory and composer(.phar) are *not* under version control | |
# - Composer is installed as an executable at /usr/local/bin/composer |
TL;DR
Create a backup:
pg_dumpall > mybackup.sql
Perform the upgrade:
sudo pg_dropcluster 9.4 main --stop
$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add bootstrap@4.0.0-beta jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
This gist will collects all issues we solved with Rails 5.2 and Webpacker
# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
# config/initializers/activestorage.rb | |
Rails.application.config.to_prepare do | |
# Provides the class-level DSL for declaring that an Active Record model has attached blobs. | |
ActiveStorage::Attached::Macros.module_eval do | |
def has_one_attached(name, dependent: :purge_later, acl: :private) | |
class_eval <<-CODE, __FILE__, __LINE__ + 1 | |
def #{name} | |
@active_storage_attached_#{name} ||= ActiveStorage::Attached::One.new("#{name}", self, dependent: #{dependent == :purge_later ? ":purge_later" : "false"}, acl: "#{acl}") | |
end | |
# be sure to comment out the require 'capistrano/deploy' line in your Capfile! | |
# config valid only for Capistrano 3.1 | |
lock '3.2.1' | |
set :application, 'my-cool-application' | |
# the base docker repo reference | |
set :name, "johns-stuff/#{fetch(:application)}" |
version: '3' | |
services: | |
mysqldb: | |
image: mysql:5.7.22 | |
container_name: mysql_container_name | |
restart: always | |
ulimits: | |
nproc: 65535 | |
nofile: | |
soft: 20000 |