-
Open the Terminal
-
Use
mysqldumpto backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql -
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
| # config/deploy.rb | |
| require 'mina/bundler' | |
| require 'mina/rails' | |
| require 'mina/git' | |
| require 'mina/rvm' | |
| # ter_mode 这个要设置,不然在 mac 下输密码有问题 | |
| set :term_mode, nil | |
| set :rvm_path, '/usr/local/rvm/bin/rvm' |
| require 'mina/bundler' | |
| require 'mina/rails' | |
| require 'mina/git' | |
| require 'mina/rvm' # for rvm support. (http://rvm.io) | |
| set :domain, 'deploy@host' | |
| set :repository, 'git... | |
| set :branch, 'master' | |
| set :shared_paths, ['config/database.yml', 'config/application.yml', 'log', 'tmp/sockets', 'tmp/pids'] |
| class UsersController < ApplicationController | |
| def new | |
| @user = UserInformation.new | |
| end | |
| def index | |
| @users = UserInformation.all | |
| end |
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |
This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :
| ===Install Octopress=== | |
| git clone git://github.com/imathis/octopress.git | |
| cd octopress | |
| gem install bundler rake --no-rdoc --no-ri | |
| bundle install | |
| rake install | |
| ===Start Blogging=== |
| --- | |
| development: | |
| cloud_name: cloud_name | |
| api_key: 'api_key' | |
| api_secret: api_secret | |
| enhance_image_tag: true | |
| static_image_support: false | |
| production: | |
| cloud_name: cloud_name | |
| api_key: 'api_key' |
It looks as though using Release Phase commands (available as of 2 June 2016) is the preferred way of running things like migrations after the slug has been compiled and deployed.
The Buildpack API explicitly suggests avoiding side effects during the build:
Buildpack developers should avoid generating side effects during the build. For example, it is not recommended to perform database migrations in the compile script.
The following example creates a Rails app with a single migration and demonstrates that the migration is run after deployment.
# Create empty Rails app