Here is my gem: https://github.com/DerNalia/deep_cloning
and this is how I include it in my gemfile:
gem "deep_cloning", :git => "git://github.com/DerNalia/deep_cloning.git"
The line that the following error is on is this:
ActiveRecord::Base.extend(DeepCloning)
link to source file: https://github.com/DerNalia/deep_cloning/blob/master/lib/deep_cloning.rb
… so.. maybe I’m extending ActiveRecord::Base wrong?
% bundle exec script/server -p3001
=> Booting WEBrick
=> Rails 2.3.8 application starting on http://0.0.0.0:3001
/Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant ActiveRecord (NameError)
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in `rake_original_const_missing'
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing'
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:92:in `const_missing'
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/bundler/gems/deep_cloning-4d4df89848a4/lib/deep_cloning.rb:102
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `require'
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
from /Users/me/Work/GravityLabs/myproject/config/environment.rb:68
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/rails-2.3.8/lib/initializer.rb:111:in `run'
from /Users/me/Work/GravityLabs/myproject/config/environment.rb:16
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /Users/me/Work/GravityLabs/myproject/config.ru:3
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/rack-1.1.3/lib/rack/builder.rb:46:in `instance_eval'
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/rack-1.1.3/lib/rack/builder.rb:46:in `initialize'
from /Users/me/Work/GravityLabs/myproject/config.ru:1:in `new'
from /Users/me/Work/GravityLabs/myproject/config.ru:1
from script/server:3:in `eval'
from /Users/me/.rvm/gems/ruby-1.8.7-p352@myproject/gems/rails-2.3.8/lib/commands/server.rb:78
from script/server:3:in `require'
from script/server:3
You should probably try
require 'activerecord'in your gem.Regarding
extendandinclude: