Skip to content

Instantly share code, notes, and snippets.

ruby-1.9.2-p0 > sub_end.strftime("Ends on %m/%d/%Y at %I:%M%p")
NoMethodError: undefined method `strftime' for 1315186557:Fixnum
from (irb):12
from /.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.9/lib/rails/commands/console.rb:44:in `start'
from /.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.9/lib/rails/commands/console.rb:8:in `start'
from /.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.9/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
ruby-1.9.2-p0 > sub_end
=> 1315186557
@NeMO84
NeMO84 / .gemrc
Last active November 23, 2015 20:39 — forked from jch/.gemrc
Base .gemrc file example.
# http://guides.rubygems.org/command-reference/#gem-environment
---
gem: --no-document
benchmark: false
verbose: true
update_sources: true
sources:
- https://rubygems.org
backtrace: true
bulk_threshold: 1000
@NeMO84
NeMO84 / update-coreos-cloud-config.sh
Created December 7, 2015 08:21 — forked from maxcnunes/update-coreos-cloud-config.sh
Update coreos cloud config
#!/bin/bash
SERVER_IP=<MY_SERVER_IP>
# copy cloud-config.yml to the server
scp cloud-config.yml core@$SERVER_IP:~/
# validate cloud-config file
ssh core@$SERVER_IP "coreos-cloudinit -validate --from-file ~/cloud-config.yml"
if [[ $? == "0" ]]; then

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