Fixing "A copy of Klass has been removed from the module tree but is still active"

This can happen during development when classes without automatic reloading are pointing to classes with automatic reloading. E.g. some class in lib is calling Model.static_method.

Workaround A

Stop referencing autoloaded classes from static files. If you can't, see workaround B and C.

Workaround B

Make sure the offending file (the one referencing the autoloaded class) is autoloaded, too. You may do this:

# config/application.rb

  config.paths.add 'offending/file/parent/directory', eager_load: true

Workaroun...

Typical .gitignore

log/*
tmp/*
storage/*
db/*.sqlite3
db/schema.rb
db/structure.sql
public/system
.project
.idea/
public/javascripts/all*
public/stylesheets/all*
public/stylesheets/*.css
config/database.yml
*~
*#*
.#*
.DS_Store
webrat-*.html
capybara-*.html
rerun.txt
coverage.data
coverage/*
dump_for_download.dump
.~lock.*
.*.swp
C:\\nppdf32Log\\debuglog.txt

How to fix "Too many authentic authentication failures" with SSH and/or Capistrano

You are getting when connecting via SSH or deploying with Capistrano (which uses SSH):

Too many authentication failures for username

This is caused by having too many SSH keys added to your keyring or ssh-agent. Your ssh-agent will throw all keys against a server until one matches. Most servers will deny access after 5 attempts.

This issue might come and go as the order of the active SSH keys in your ssh-agent changes.

Quick fix

Have less keys. Up to 5 keys are fine when the SSHD you're connecting to is using the default ...

Why your all.js is empty on staging or production

When you include a non-existing Javascript file, you probably won't notice it during development. But with caching active (on production or staging) Rails will write an empty all.js file without complaining.