! Fingerprint already exists. Please use one ssh key per Heroku account

Trying to change Heroku command-line users to add add-ons for the user in our organization that has the credit card information associated with him (Bill).

My account info: anthony@example.com His account: bill@example.com

Can run this to clear out my current Heroku username and password:

rm ~/.heroku/credentials

But unfortunately even after I authenticate with the new username and password, things don’t quite work right:

$ heroku list
Enter your Heroku credentials.
Email: bill@example.com
Password: 
Uploading ssh public key /Users/anthony/.ssh/id_rsa.pub
 !   Fingerprint already exists. Please use one ssh key per Heroku account

The problem is that the ssh key I’m trying to use is already associated with anthony@example.com’s account. So I need to generate a new one:

$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/anthony/.ssh/id_rsa): /Users/anthony/.ssh/bill_id_rsa
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/anthony/.ssh/bill_id_rsa.
Your public key has been saved in /Users/anthony/.ssh/bill_id_rsa.pub.
The key fingerprint is:
[snip] anthony@Anthonys-MacBook-Pro.local
The key's randomart image is:
[snip]

Then I can run:

$ heroku keys:add /Users/anthony/.ssh/bill_id_rsa.pub
Enter your Heroku credentials.
Email: bill@example.com
Password: 
Uploading ssh public key /Users/anthony/.ssh/bill_id_rsa.pub

Getting autotest working with Rails 3

Here’s all the stuff I needed to get autotest (formerly known as autospec) working with Rails 3 and rspec 2. I’m assuming you are using bundler.

# Gemfile
source 'http://rubygems.org'

gem 'rails', '3.0.1'

group :development, :test do
  gem 'rspec'
  gem 'rspec-rails'

  group :autotest do 
    gem 'ZenTest'
    gem 'autotest'
    gem 'autotest-rails'
  end
end
# .rspec
--format nested
--color
# autotest/discover.rb
Autotest.add_discovery { "rails" }
Autotest.add_discovery { "rspec2" }

Then you can run:

$ autotest

at the command-line to run your specs automatically in a continuous testing fashion.

Could not find gem 'zentest (>= 0, runtime)' in any of the gem sources

Trying to install ZenTest gem, and came upon this error after adding:

group :development, :test do
  gem 'rspec'
  gem 'rspec-rails'
  gem 'cucumber'
  gem 'cucumber-rails'
  gem 'webrat'
  gem 'nokogiri'
  gem 'zentest' #######
end
$ bundle install
Fetching source index for http://rubygems.org/
Could not find gem 'zentest (>= 0, runtime)' in any of the gem sources.

The solution was to realize that ZenTest actually capitalizes the gem name. I think this is the only gem that does this that I know of.

group :development, :test do
  gem 'rspec'
  gem 'rspec-rails'
  gem 'cucumber'
  gem 'cucumber-rails'
  gem 'webrat'
  gem 'nokogiri'
  gem 'ZenTest' #######
end

pg_ext.bundle: [BUG] Segmentation fault

Trying to run the Rails 3 console using rvm and zsh and Mac OSX (Snow Leopard), and ran into the following problem:

$ rails console
~/.rvm/gems/ruby-1.9.2-p0@dealshare-backend/gems/pg-0.9.0/lib/pg_ext.bundle: [BUG] Segmentation fault
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

zsh: abort      rails console

The 1.8.7 was confusing, since I was running 1.9.2 (as Rails 3 requires.) I merely removed 1.8.7, as I didn’t need it anymore. This seemed to fix the problem, although it hardly seems optimal

I was trying to run rake gems:install on a rails application that I cloned, and got repeated errors saying:

no such file to load

and then the name of a gem that I had. This apparently can happen when you have gems required before you can get to the section in your configuration file that specifies the different gems that you will be installing. One solution is to manually install the gems until you can do rake gems:install successfully. This is suboptimal since rake gems:install won’t work out of the box for others either.

A better solution is to figure out where the problematic require statements are and remove them. Then the full power of this command can be realized.