Skip to content

Instantly share code, notes, and snippets.

@damjack
damjack / README.md
Last active October 1, 2022 22:24 — forked from webdev1001/gist:e848abef8064c55c2f6443a282f75651
Array values in the parameter to `Gem.paths=` are deprecated.

Array values in the parameter to Gem.paths= are deprecated. Please use a String or nil. An Array (...) was passed in from bin/rails:3:in `load'

Solution

ruby/rubygems#1551

If you came to this issue by googling the error specified in the description of this issue, you should know that it has already been fixed in spring-1.6.4 and all you need to do is to update to latest spring and regenerate binstubs, like this:

@damjack
damjack / gist:816a30c0ec46662690750d2733893ae4
Created August 28, 2018 10:38 — forked from hpjaj/gist:ef5ba70a938a963332d0
RSpec - List of available Expectation Matchers - from Lynda.com course 'RSpec Testing Framework with Ruby'
## 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)

Pry Cheat Sheet

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 session

Debugger

@damjack
damjack / psql-ssh-tunnel.md
Created May 25, 2018 21:51 — forked from noteed/psql-ssh-tunnel.md
SSH tunnel for PostgreSQL connection

SSH tunnel for PostgreSQL connection

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