$ su postgres
$ psql -U postgres
psql (9.2.4)
Type "help" for help.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app / controllers / application_controller.rb | |
class ApplicationController < ActionController::Base | |
# Prevent CSRF attacks by raising an exception. | |
# For APIs, you may want to use :null_session instead. | |
protect_from_forgery with: :exception | |
before_filter :configure_permitted_parameters, if: :devise_controller? | |
protected | |
def configure_permitted_parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minibook:sandbox aj$ ruby -v | |
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin11.4.2] | |
minibook:sandbox aj$ rvm gemset use mytest --create | |
minibook:sandbox aj$ gem install rails --version=4.0.0.rc2 | |
Fetching: i18n-0.6.4.gem (100%) | |
Successfully installed i18n-0.6.4 | |
Fetching: multi_json-1.7.7.gem (100%) | |
Successfully installed multi_json-1.7.7 | |
Fetching: tzinfo-0.3.37.gem (100%) | |
Successfully installed tzinfo-0.3.37 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################## | |
####### $ rvm --debug requirements ruby ##### | |
############################################## | |
$ rvm --debug requirements ruby | |
rvm_autolibs_flag=enable | |
Installing requirements for osx, might require sudo password. | |
requirements code for osx loaded | |
brew seems to be writable | |
Install custom packages: homebrew/dupes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rvm --trace requirements ruby | |
+ [[ -n '' ]] | |
+ set -o errtrace | |
+ export 'PS4=+ $(date "+%s.%N") ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > ' | |
+ PS4='+ $(date "+%s.%N") ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > ' | |
+ 1370044767.N /scripts/cli : __rvm_parse_args() 709 > [[ -z '' ]] | |
+ 1370044767.N /scripts/cli : __rvm_parse_args() 709 > [[ -n '' ]] | |
+ 1370044767.N /scripts/cli : __rvm_parse_args() 712 > [[ error == '' ]] | |
+ 1370044767.N /scripts/cli : __rvm_parse_args() 712 > [[ 0 -eq 1 ]] | |
+ 1370044767.N /scripts/cli : __rvm_parse_args() 712 > [[ -n '' ]] |
$ brew install pcre
$ gem install passenger
$ passenger-install-nginx-module
https://www.phusionpassenger.com/download
TODO:
- create a deploy user and group
Updated: July 12, 2013
The instructions below are just quick references if you know what you're doing.
If you are installing RVM, Ruby, and Rails for the first time, I'd recommend following Daniel Kehoe's instructions:
http://railsapps.github.io/installing-rails.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Ruby code snippets to determine host OS and currently running ruby version | |
############################################################## | |
# RbConfig to determine host OS and exit if not mac or linux # | |
############################################################## | |
require 'rbconfig' | |
@os = RbConfig::CONFIG['host_os'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This script adds an empty Macintosh HD directory to the CS6 installation which K4 depends on for non-admin users. | |
# This script must be run with sudo from Terminal or deployed as an Administrator with Remote Desktop | |
# ie: | |
# $ sudo ./k4-hotfix.sh | |
# If you are unable to execute this file make sure it has executable permissions. | |
# $ chmod 777 k4-hotfix.sh | |
mkdir -p /Applications/Adobe\ InDesign\ CS6/Adobe\ InDesign\ CS6.app/Contents/MacOS/Macintosh\ HD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This works | |
$ gem install colorize | |
$ ruby -rubygems -e 'require "colorize"; puts "This is a blinking blue on red string".blue.on_red.blink' | |
# this is broken | |
gem install chromatic | |
$ ruby -rubygems -e 'require "chromatic"; puts "This is a blinking blue on red string".blue.on_red.blink' |