Skip to content

Instantly share code, notes, and snippets.

Unhandled exception: (Time::Location::InvalidTZDataError)
from /usr/local/Cellar/crystal/0.27.0/src/time/location/loader.cr:86:5 in 'read_zoneinfo'
from /usr/local/Cellar/crystal/0.27.0/src/crystal/system/unix/time.cr:59:9 in 'load_localtime'
from /usr/local/Cellar/crystal/0.27.0/src/time/location.cr:339:10 in 'load_local'
from /usr/local/Cellar/crystal/0.27.0/src/time/location.cr:320:38 in 'local'
from /usr/local/Cellar/crystal/0.27.0/src/time.cr:367:16 in 'now'
from lib/amber/src/amber/server/server.cr:55:14 in 'start'
from lib/amber/src/amber/server/server.cr:50:9 in 'run'
from lib/amber/src/amber/server/server.cr:17:7 in 'start'
from src/blogway.cr:3:1 in '__crystal_main'
require "pg"
DB.open "postgres://postgres:postgres@localhost:5432/blog_development" do |db|
db.transaction do |tx|
conn = tx.connection
pp conn.scalar "select count(*) from articles" # => 5
pp conn.exec "insert into articles (title, url, markdown, created_at, updated_at) values ('title', 'url', 'markdown', now(), now())"
pp db.scalar "select count(*) from articles" # => 5 (because this established another connection)
pp conn.scalar "select count(*) from articles" # => 6
@satooshi
satooshi / QueueRunner.rb
Created August 12, 2019 12:29
Run rspec in parallel
#!/usr/bin/env ruby
require 'concurrent'
require 'coverage'
require 'parallel'
require 'rspec/core'
# serializable notifications inter processes
class FailedExampleNotification