Skip to content

Instantly share code, notes, and snippets.

View alexagui's full-sized avatar

Alex Aguilar alexagui

View GitHub Profile
@alexagui
alexagui / postgresapp_induction_rails.md
Created June 29, 2012 01:18
Migrate a Rails project to Postgresql with Postgres.app and Induction

I had issues installing Postgres with the instructions in this Railscast. However I was able to get postgres running on my project with http://postgresapp.com/ and http://inductionapp.com/ (Hat tip to this stackoverflow thread).

  1. Download & install Postgres.app (documentation) Make sure to install in /Applications.
  2. Update your PATH
    In my case I added the following to ~/.bash_profile
    export PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
    Check that Postgres.app is being loaded
$ which psql
/Applications/Postgres.app/Contents/MacOS/bin/psql
@alexagui
alexagui / README.md
Created June 16, 2012 17:02 — forked from croaky/README.md
Typical README for a thoughtbot Rails app that is deployed to Heroku

Rails app

is a Rails 3.1 app running on Ruby 1.9.2 and deployed to Heroku's Cedar stack. It has an RSpec and Cucumber test suite which should be run before commiting to the master branch.

Running tests

Create aliases:

@alexagui
alexagui / heroku.md
Created June 16, 2012 03:05 — forked from jaymcgavren/heroku.md
A Code TV screencast on getting started with Heroku

Description

Heroku is a simple way to publish your Rails app, and a powerful platform that will allow it to scale. In this episode, Jay McGavren gets you started with your first Heroku app.

Set up your Rails app

Isolate your gem environment

  • You WANT Rails to fail locally if a gem isn't in your Gemfile
@alexagui
alexagui / everyday_rails_rspec.md
Created May 16, 2012 00:15
Everyday Rails RSpec
@alexagui
alexagui / everyday_rails_rspec.md
Created May 9, 2012 23:42
Everyday Rails RSpec

p.6
launchy and guard-rspec are mentioned but they're not in the Gemfile

p.15

Though it's later explained that Factory() is a shortcut for Factory.create(). The section below might read more clearly with explicit calls to create()

Can you guess the difference? Factory.create() builds the model and saves it, while Factory.build() 
instantiates a new model, but doesn’t save it. If we used Factory.create() in this example it would break 
@alexagui
alexagui / ruby_debug_pow.markdown
Created July 22, 2011 03:26
How to Ruby Debug with Pow

How to Ruby Debug with Pow

Below are steps I followed to get ruby debugger ruby-debug running with Pow. Based on info from this thread basecamp/pow#43 and this blog post http://flochip.com/2011/04/13/running-pow-with-rdebug/

1) Update your Gemfile

Assuming you're writing your app in Ruby 1.9 and using Bundler, just add the dependency to your development gems:

@alexagui
alexagui / debugger.markdown
Created July 22, 2011 02:50 — forked from jcasimir/debugger.markdown
Ruby Debugger

Ruby Debugger

Most of the time simple output statements using warn, raise, or a logger will help you find your issue. But sometimes you need the big guns, and that means ruby-debug.

Ruby-Debug

The ruby-debug package has had some rocky times during the transition from Ruby 1.8.7 to 1.9.2 and beyond. But now, finally, the debugger is reliable and usable.

Installation