Started getting error below with edge mongoid.
aki@rydeen~/Dropbox/RubyProjects/zitta-orders > rails c
Loading development environment (Rails 3.2.6)
ruby-1.9.2-p290 :001 > ap 'wheee'
NameError: uninitialized constant BSON
from /Users/aki/.rvm/gems/ruby-1.9.2-p290/gems/awesome_print-1.0.2/lib/awesome_print/ext/mongoid.rb:23:in `cast_with_mongoid'
from /Users/aki/.rvm/gems/ruby-1.9.2-p290/gems/awesome_print-1.0.2/lib/awesome_print/formatter.rb:24:in `format'
from /Users/aki/.rvm/gems/ruby-1.9.2-p290/gems/awesome_print-1.0.2/lib/awesome_print/inspector.rb:104:in `unnested'
from /Users/aki/.rvm/gems/ruby-1.9.2-p290/gems/awesome_print-1.0.2/lib/awesome_print/inspector.rb:71:in `awesome'
from /Users/aki/.rvm/gems/ruby-1.9.2-p290/gems/awesome_print-1.0.2/lib/awesome_print/core_ext/kernel.rb:10:in `ai'
from /Users/aki/.rvm/gems/ruby-1.9.2-p290/gems/awesome_print-1.0.2/lib/awesome_print/core_ext/kernel.rb:15:in `ap'
from (irb):1
from /Users/aki/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.6/lib/rails/commands/console.rb:47:in `start'
from /Users/aki/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.6/lib/rails/commands/console.rb:8:in `start'
from /Users/aki/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.6/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
This is because awesome_print uses ::BSON::ObjectId constant which got renamed to Moped::BSON::ObjectId (by commit http://goo.gl/RSZos)
To get ap working again, add the following to bottom of your application.rb file:
BSON=Moped::BSON
Since you only need it in irb/pry, I think putting it in the ~/.irbrc or ~/.pryrc is better since it solves the issue for all projects and keeps your application code clean.
you can put it in a if or a begin rescue in case you work on non mongoid projects ;)