add gem into Gemfile:
gem "rails", ">= 5.2.0.rc2"
install new gem with:
| # for colors | |
| export CLICOLOR=1 | |
| export LSCOLORS=ExFxCxDxBxegedabagacad | |
| # grep colors | |
| # export GREP_OPTIONS="--color=auto" | |
| # alias command | |
| alias grep="ggrep" | |
| alias g="git" |
| FROM ubuntu:latest | |
| RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \ | |
| && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 | |
| ENV LANG en_US.utf8 | |
| EXPOSE 4567 | |
| ENV HOME /root | |
| RUN apt-get -y update && \ |
Create a .pgpass file that will be used to provide the password for any libpq-based program for the matching hostname/port/database/user. That file should be chmod'd 0600.
> cat .pgpass
127.0.0.1:5433:database:user:password
Create a SSH tunnel: we open the local port 5433 and, out of the tunnel, go to localhost:5432. You probably really want localhost and not remote: your PostgreSQL database is probably accepting connections only from locahost.
> ssh -N -L 5433:localhost:5432 user@remote
To make this better, we are going install a new, custom Ruby. This used to be a big, scary thing, but thanks to the awesome tools Homebrew and rbenv, it's a snap.*
A word of warning: you will have to use Terminal to install this stuff. If you are uncomfortable with text, words, and doing stuff with your computer beyond pointing and hoping, this may not work well for you. But if that's the case, I'm not sure why you were trying to use Ruby in the first place.
Homebrew (or just brew, since that's the name of the command you'll use), is a package manager for Mac OS. It make installing all sorts of cool tools easy.
| " We're running Vim, not Vi! | |
| execute pathogen#infect() | |
| " Enable syntax highlighting | |
| syntax on | |
| " Enable filetype detection | |
| filetype on | |
| " Enable filetype-specific indenting | |
| filetype indent on | |
| " Enable filetype-specific plugins | |
| filetype plugin indent on |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>ANSIBlackColor</key> | |
| <data> | |
| YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
| AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T | |
| Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECgwLjE1Njg2OTg4 | |
| ODMgMC4xNzI0OTg3MzI4IDAuMjAzODUxNTgwNiAxTxAnMC4xMTc4NDk5NjA5IDAuMTI4 |
Command Line
pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb - load your rails into a pry sessionDebugger
| ## From Lynda.com course 'RSpec Testing Framework with Ruby' | |
| describe 'Expectation Matchers' do | |
| describe 'equivalence matchers' do | |
| it 'will match loose equality with #eq' do | |
| a = "2 cats" | |
| b = "2 cats" | |
| expect(a).to eq(b) |