Skip to content

Instantly share code, notes, and snippets.

Alex Aguilar alexagui

Block or report user

Report or block alexagui

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alexagui
alexagui / postgresapp_induction_rails.md
Created Jun 29, 2012
Migrate a Rails project to Postgresql with Postgres.app and Induction
View postgresapp_induction_rails.md

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 Jun 16, 2012 — forked from croaky/README.md
Typical README for a thoughtbot Rails app that is deployed to Heroku
View README.md

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 Jun 16, 2012 — forked from jaymcgavren/heroku.md
A Code TV screencast on getting started with Heroku
View heroku.md

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
View everyday_rails_rspec.md
View everyday_rails_rspec.md

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 Jul 22, 2011
How to Ruby Debug with Pow
View ruby_debug_pow.markdown
View debugger.markdown

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

You can’t perform that action at this time.