undefined method `content_length' for nil:NilClass fog storage [carrierwave] - ruby-on-rails

I have two models using the same uploader in a rails project with carrierwave
class Brand < ActiveRecord::Base
mount :avatar, AvatarUploader
end
class Profile < ActiveRecord::Base
mount :avatar, AvatarUploader
end
Then when I try to copy one image to another model
profile.avatar = brand.avatar
profile.save!
it fails with the following stacktrace
undefined method `content_length' for nil:NilClass
usr/lib64/ruby/gems/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/storage/fog.rb:238:in `size'
/usr/lib64/ruby/gems/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/uploader/proxy.rb:57:in `size'
/usr/lib64/ruby/gems/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/sanitized_file.rb:95:in `size'
/usr/lib64/ruby/gems/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/sanitized_file.rb:135:in `empty?'
/usr/lib64/ruby/gems/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/uploader/cache.rb:119:in `cache!'
/usr/lib64/ruby/gems/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/mount.rb:327:in `cache'
/usr/lib64/ruby/gems/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/mount.rb:179:in `avatar='
/usr/lib64/ruby/gems/1.9.1/gems/carrierwave-0.9.0/lib/carrierwave/orm/activerecord.rb:38:in `avatar='
/usr/share/nginx/cranberrychic/releases/20140213171925/app/services/brand_into_user_converter.rb:42:in `copy_avatar'
/usr/share/nginx/cranberrychic/releases/20140213171925/app/services/brand_into_user_converter.rb:13:in `convert'
(irb):64:in `block (2 levels) in irb_binding'
/usr/lib64/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/usr/lib64/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/transactions.rb:208:in `transaction'
/usr/lib64/ruby/gems/1.9.1/gems/newrelic_rpm-3.6.0.78/lib/new_relic/agent/method_tracer.rb:486:in `block in transaction_with_trace_ActiveRecord_self_name_transaction'
/usr/lib64/ruby/gems/1.9.1/gems/newrelic_rpm-3.6.0.78/lib/new_relic/agent/method_tracer.rb:235:in `trace_execution_scoped'
/usr/lib64/ruby/gems/1.9.1/gems/newrelic_rpm-3.6.0.78/lib/new_relic/agent/method_tracer.rb:481:in `transaction_with_trace_ActiveRecord_self_name_transaction'
(irb):62:in `block in irb_binding'
/usr/lib64/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/relation/delegation.rb:6:in `each'
/usr/lib64/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/relation/delegation.rb:6:in `each'
(irb):59:in `irb_binding'
/usr/lib64/ruby/1.9.1/irb/workspace.rb:80:in `eval'
/usr/lib64/ruby/1.9.1/irb/workspace.rb:80:in `evaluate'
/usr/lib64/ruby/1.9.1/irb/context.rb:254:in `evaluate'
/usr/lib64/ruby/1.9.1/irb.rb:159:in `block (2 levels) in eval_input'
/usr/lib64/ruby/1.9.1/irb.rb:273:in `signal_status'
/usr/lib64/ruby/1.9.1/irb.rb:156:in `block in eval_input'
/usr/lib64/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement'
/usr/lib64/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop'
/usr/lib64/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement'
/usr/lib64/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch'
/usr/lib64/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement'
/usr/lib64/ruby/1.9.1/irb.rb:155:in `eval_input'
/usr/lib64/ruby/1.9.1/irb.rb:70:in `block in start'
/usr/lib64/ruby/1.9.1/irb.rb:69:in `catch'
/usr/lib64/ruby/1.9.1/irb.rb:69:in `start'
/usr/lib64/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands/console.rb:47:in `start'
/usr/lib64/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in `start'
/usr/lib64/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:41:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
To me is a bug of carrierwave with fog storage, because in development with the file storage everything works as expected. When I try to copy an image from a model to another in any way possible with carrierwave, it fails with the same error
My carrierwave version is 0.9.0
and rails version is 3.2.13 and ruby 1.9.3-p327

I believe you doing it wrong
profile.avatar = brand.avatar
will not work because profile.avatar= need a file object and brand.avatar don't give you a file object (it return you a uploader i.e avatar object)
I believe your looking for this approach
profile.remote_avatar_url = brand.avatar.url
profile.save!
Considering the brand.avatar.url give you a url from where carrierwave can download the file
More information about remote_{uploader}_url can also be found in Carrierwave Readme
Hope this help

Related

Rails: Rake gives Zeitwerk error when mentioning one model class in another

So I'm having a really weird rails problem (6.1.4). Everything runs fine in normal operation but when I try to use some of my models from inside a rake task (e.g. code in seeds.rb) I get the following error: TypeError: superclass mismatch for class Comment
After doing a bunch of digging, I've narrowed the culprit down to the fact that inside one of my model classes I reference the name of another. Specifically, the following code suffices to create the problem
class Question < ApplicationRecord
include JsonHelpers
include PostableHelpers
puts "#{Comment.inspect}"
end
Note that the error still happens when I comment out the whole body of the Comment class so it is just
class Comment < ApplicationRecord
end
Where Comment is another model (in models/comment.rb inheriting from ApplicationRecord). If I delete the reference to Comment in Question there is no problem (but any such reference causes the issue), nor is there a problem when I simply respond to web requests. (In my real code I have a class macro which creates a polymorphic belongs_to and takes the allowed related classes to define some utility methods and validation).
It feels like it's some kind of problem with loading constants but I have no idea how to go about fixing it. Even a simple pointer in the right direction would be super helpful.
I've included the whole error below for completeness. I'm happy to add more code if it helps, but short of just posting the whole application I'm not sure what would be relevant.
/Users/TruePath/Build/math-site/app/models/comment.rb:1:in `<main>'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
/Users/TruePath/Build/math-site/app/models/question.rb:8:in `<class:Question>'
/Users/TruePath/Build/math-site/app/models/question.rb:1:in `<main>'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
/Users/TruePath/Build/math-site/app/models/post.rb:18:in `<class:Post>'
/Users/TruePath/Build/math-site/app/models/post.rb:1:in `<main>'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
/Users/TruePath/Build/math-site/app/models/tagging.rb:5:in `<class:Tagging>'
/Users/TruePath/Build/math-site/app/models/tagging.rb:1:in `<main>'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/inflector/methods.rb:288:in `const_get'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/inflector/methods.rb:288:in `block in constantize'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/inflector/methods.rb:284:in `each'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/inflector/methods.rb:284:in `inject'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/inflector/methods.rb:284:in `constantize'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/inflector/methods.rb:330:in `safe_constantize'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/dependencies/zeitwerk_integration.rb:23:in `safe_constantize'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/inheritance.rb:230:in `block in compute_type'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/inheritance.rb:229:in `each'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/inheritance.rb:229:in `compute_type'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/reflection.rb:409:in `compute_class'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/reflection.rb:366:in `klass'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/reflection.rb:791:in `source_reflection'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/reflection.rb:932:in `check_validity!'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/associations/association.rb:41:in `initialize'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/associations/has_many_through_association.rb:10:in `initialize'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/associations.rb:315:in `new'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/associations.rb:315:in `association'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/associations/builder/association.rb:103:in `tags'
/Users/TruePath/Build/math-site/app/models/page.rb:207:in `update_history'
/Users/TruePath/Build/math-site/app/models/page.rb:101:in `build_by_user'
/Users/TruePath/Build/math-site/db/seeds.rb:99:in `block in <main>'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `block in transaction'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/transactions.rb:209:in `transaction'
/Users/TruePath/Build/math-site/db/seeds.rb:84:in `<main>'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `load'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `load'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/railties-6.1.4/lib/rails/engine.rb:566:in `block in load_seed'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/execution_wrapper.rb:88:in `wrap'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/railties-6.1.4/lib/rails/engine.rb:640:in `block (2 levels) in <class:Engine>'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/callbacks.rb:126:in `instance_exec'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activesupport-6.1.4/lib/active_support/callbacks.rb:137:in `run_callbacks'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/railties-6.1.4/lib/rails/engine.rb:566:in `load_seed'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/tasks/database_tasks.rb:450:in `load_seed'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/activerecord-6.1.4/lib/active_record/railties/databases.rake:392:in `block (2 levels) in <main>'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/opt/local/lib/ruby3.1/gems/3.1.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/opt/local/bin/rake:25:in `load'
/opt/local/bin/rake:25:in `<main>'
/opt/local/bin/ruby_executable_hooks3.1:22:in `eval'
/opt/local/bin/ruby_executable_hooks3.1:22:in `<main>'
Tasks: TOP => db:seed
Ok, thanks to the amazing help by Xavier Noria I finally tracked it down. I'll include the answer here in case anyone else runs into the problem.
Ultimately, the issues was that I had a rake task that was defined as follows:
require 'rexml/document'
include REXML
namespace :db do
desc "Delete all unconfirmed users after 1 day"
task :import_journal_abbrevs => :environment do
...
end
Unfortunately, REXML defines a class named Comment which was conflicting with my model class of the same name. As this answer warns placing the include at the top level pollutes the Object namespace. Instead, I should have written
require 'rexml/document'
namespace :db do
desc "Delete all unconfirmed users after 1 day"
task :import_journal_abbrevs => :environment do
include REXML
...
end

NoMethodError: undefined method `each' for nil:NilClass on user creation rails

When I run my rails 5.1 app in development, everything is fine but when I run it on Heroku and try to create a user I keep getting this error.
NoMethodError: undefined method `each' for nil:NilClass
/app/vendor/bundle/ruby/2.4.0/gems/mongo-2.5.3/lib/mongo/cluster.rb:192:in `initialize'
/app/vendor/bundle/ruby/2.4.0/gems/mongo-2.5.3/lib/mongo/client.rb:454:in `new'
/app/vendor/bundle/ruby/2.4.0/gems/mongo-2.5.3/lib/mongo/client.rb:454:in `create_from_addresses'
/app/vendor/bundle/ruby/2.4.0/gems/mongo-2.5.3/lib/mongo/client.rb:253:in `initialize'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/clients/factory.rb:64:in `new'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/clients/factory.rb:64:in `create_client'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/clients/factory.rb:27:in `create'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/clients.rb:69:in `block in with_name'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/clients.rb:68:in `synchronize'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/clients.rb:68:in `with_name'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/persistence_context.rb:110:in `client'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/persistence_context.rb:70:in `collection'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/clients/options.rb:73:in `collection'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/contextual/mongo.rb:342:in `initialize'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/contextual.rb:53:in `new'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/contextual.rb:53:in `create_context'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/contextual.rb:35:in `context'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/contextual.rb:20:in `exists?'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/validatable/uniqueness.rb:276:in `validate_root'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/validatable/uniqueness.rb:48:in `block in validate_each'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/validatable/queryable.rb:23:in `with_query'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/validatable/uniqueness.rb:42:in `validate_each'
/app/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.0/lib/active_model/validator.rb:150:in `block in validate'
/app/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.0/lib/active_model/validator.rb:147:in `each'
/app/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.0/lib/active_model/validator.rb:147:in `validate'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/callbacks.rb:413:in `block in make_lambda'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/callbacks.rb:178:in `block (2 levels) in halting_and_conditional'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/callbacks.rb:601:in `block (2 levels) in default_terminator'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/callbacks.rb:600:in `catch'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/callbacks.rb:600:in `block in default_terminator'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/callbacks.rb:179:in `block in halting_and_conditional'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/callbacks.rb:507:in `block in invoke_before'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/callbacks.rb:507:in `each'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/callbacks.rb:507:in `invoke_before'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/callbacks.rb:130:in `run_callbacks'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/interceptable.rb:132:in `run_callbacks'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/callbacks.rb:825:in `_run_validate_callbacks'
/app/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.0/lib/active_model/validations.rb:405:in `run_validations!'
/app/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.0/lib/active_model/validations/callbacks.rb:110:in `block in run_validations!'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/callbacks.rb:131:in `run_callbacks'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/interceptable.rb:132:in `run_callbacks'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/callbacks.rb:825:in `_run_validation_callbacks'
/app/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.0/lib/active_model/validations/callbacks.rb:110:in `run_validations!'
/app/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.0/lib/active_model/validations.rb:335:in `valid?'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/validatable.rb:97:in `valid?'
/app/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.0/lib/active_model/validations.rb:372:in `invalid?'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/persistable/creatable.rb:117:in `prepare_insert'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/persistable/creatable.rb:23:in `insert'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/persistable/savable.rb:23:in `save'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/persistable/savable.rb:44:in `save!'
/app/db/seeds.rb:15:in `block in <top (required)>'
/app/db/seeds.rb:4:in `times'
/app/db/seeds.rb:4:in `<top (required)>'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/dependencies.rb:286:in `load'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/dependencies.rb:286:in `block in load'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/dependencies.rb:258:in `load_dependency'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.0/lib/active_support/dependencies.rb:286:in `load'
/app/vendor/bundle/ruby/2.4.0/gems/mongoid-7.0.1/lib/mongoid/railties/database.rake:20:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
/app/bin/bundle:3:in `load'
/app/bin/bundle:3:in `<main>'
I can't place what could be causing the error. It is running a DB on mongoid in mlab. Not sure if that is the cause. I can't seed the db in heroku console without getting the same error.
It looks like the Mongo driver is expecting to iterate across a number of host URIs, but has somehow managed to reach that point in the code without detecting that there aren't any defined.
As you're using Mongoid to interact with the (slight lower level) Mongo Ruby client, this file on configuration might give you some clues. You'll probably want to also refer to the documentation for whichever MongoDB add-on you have installed on Heroku.

Need to delete CarrierWave attachments with missing files

We're working with an older Carrierwave installation and had an issue that caused many of our avatars to be deleted from the S3 bucket but they're still being referenced by Carrierwave. How can I safely clear out these broken instances without breaking our other user's avatars?
Version information:
Ruby 2.1.0
carrierwave-0.5.8
excon-0.32.0
fog-0.7.2
railties-3.2.18
I can't upgrade the gems any further at this point because there are other dependencies that will introduce breaking changes.
I've tried to instance.remove_avatar! functionality but that fails with the following error.
irb(main):041:0> t.remove_avatar!
Digest::Digest is deprecated; use Digest
[excon][WARNING] Invalid Excon request keys: :host
/app/vendor/bundle/ruby/2.1.0/gems/excon-0.32.0/lib/excon/connection.rb:389:in `validate_params'
/app/vendor/bundle/ruby/2.1.0/gems/excon-0.32.0/lib/excon/connection.rb:225:in `request'
/app/vendor/bundle/ruby/2.1.0/gems/fog-0.7.2/lib/fog/core/connection.rb:20:in `request'
/app/vendor/bundle/ruby/2.1.0/gems/fog-0.7.2/lib/fog/storage/aws.rb:323:in `request'
/app/vendor/bundle/ruby/2.1.0/gems/fog-0.7.2/lib/fog/storage/requests/aws/delete_object.rb:20:in `delete_object'
/app/vendor/bundle/ruby/2.1.0/gems/fog-0.7.2/lib/fog/storage/models/aws/file.rb:58:in `destroy'
/app/vendor/bundle/ruby/2.1.0/gems/carrierwave-0.5.8/lib/carrierwave/storage/fog.rb:178:in `delete'
/app/vendor/bundle/ruby/2.1.0/gems/carrierwave-0.5.8/lib/carrierwave/uploader/remove.rb:15:in `block in remove!'
/app/vendor/bundle/ruby/2.1.0/gems/carrierwave-0.5.8/lib/carrierwave/uploader/callbacks.rb:17:in `with_callbacks'
/app/vendor/bundle/ruby/2.1.0/gems/carrierwave-0.5.8/lib/carrierwave/uploader/remove.rb:14:in `remove!'
/app/vendor/bundle/ruby/2.1.0/gems/carrierwave-0.5.8/lib/carrierwave/mount.rb:365:in `remove!'
/app/vendor/bundle/ruby/2.1.0/gems/carrierwave-0.5.8/lib/carrierwave/mount.rb:205:in `remove_avatar!'
(irb):41:in `irb_binding'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb/workspace.rb:86:in `eval'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb/workspace.rb:86:in `evaluate'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb/context.rb:380:in `evaluate'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb.rb:492:in `block (2 levels) in eval_input'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb.rb:624:in `signal_status'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb.rb:489:in `block in eval_input'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb/ruby-lex.rb:247:in `block (2 levels) in each_top_level_statement'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb/ruby-lex.rb:233:in `loop'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb/ruby-lex.rb:233:in `block in each_top_level_statement'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb/ruby-lex.rb:232:in `catch'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb/ruby-lex.rb:232:in `each_top_level_statement'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb.rb:488:in `eval_input'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb.rb:397:in `block in start'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb.rb:396:in `catch'
/app/vendor/ruby-2.1.0/lib/ruby/2.1.0/irb.rb:396:in `start'
/app/vendor/bundle/ruby/2.1.0/gems/railties-3.2.18/lib/rails/commands/console.rb:47:in `start'
/app/vendor/bundle/ruby/2.1.0/gems/railties-3.2.18/lib/rails/commands/console.rb:8:in `start'
/app/vendor/bundle/ruby/2.1.0/gems/railties-3.2.18/lib/rails/commands.rb:41:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'
=> [:remove_versions!]
I've opened up an issue on Carrierwave's Github tracker as well.
I'm going to close the issue as we were able to work around.
I'd forgotten to mentioned that we are also using the carrierwave-mongoid. Which I think saved our butt.
By setting the instance avatar manually then resaving the model and ignoring the Excon error we forced the models to use their default image.
So in this case, given we have an instance of a model named t.
> t[:avatar] = nil
> t.save rescue nil
This changed the avatar.url to resolve as the default image.

ruby on rails model creation error

i am new to ruby.
When i am creating the model it gives the following error. Please resolve this issue.
noexec.rb:75:in `block in setup': undefined method `name' for ["hike-1.2.3", #<Gem::Specification name=hike version=1.2.3>]:Array (NoMethodError)
from /home/rajesh/.rvm/gems/ruby-1.9.3-p484#global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `each'
from /home/rajesh/.rvm/gems/ruby-1.9.3-p484#global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `map'
from /home/rajesh/.rvm/gems/ruby-1.9.3-p484#global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `setup'
from /home/rajesh/.rvm/gems/ruby-1.9.3-p484#global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:114:in `check'
from /home/rajesh/.rvm/gems/ruby-1.9.3-p484#global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:121:in `<top (required)>'
from /home/rajesh/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:33:in `require'
from /home/rajesh/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:33:in `rescue in require'
from /home/rajesh/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:29:in `require'
from /home/rajesh/.rvm/gems/ruby-1.9.3-p484#global/gems/rubygems-bundler-1.4.2/lib/rubygems_executable_plugin.rb:4:in `block in <top (required)>'
from /home/rajesh/.rvm/gems/ruby-1.9.3-p484#global/gems/executable-hooks-1.3.1/lib/executable-hooks/hooks.rb:50:in `call'
from /home/rajesh/.rvm/gems/ruby-1.9.3-p484#global/gems/executable-hooks-1.3.1/lib/executable-hooks/hooks.rb:50:in `block in run'
from /home/rajesh/.rvm/gems/ruby-1.9.3-p484#global/gems/executable-hooks-1.3.1/lib/executable-hooks/hooks.rb:49:in `each'
from /home/rajesh/.rvm/gems/ruby-1.9.3-p484#global/gems/executable-hooks-1.3.1/lib/executable-hooks/hooks.rb:49:in `run'
from /home/rajesh/.rvm/gems/ruby-1.9.3-p484#global/bin/ruby_executable_hooks:10:in `<main>'
I'll assume you're using this https://github.com/sstephenson/hike
Remove it from your project and start again - if the model gets created then problem is in the hike gem,
then try different versions of the gem, see on https://github.com/sstephenson/hike if there's a similar reported issue

Error on Rails Admin install. Possibly Devise related?

Sorry to copy in this entire log, but I'm hoping it might make more sense to someone familiar with this issue. When devise began setting up the user model I wasn't given the option (I never pressed enter) and the install proceeded and crashed, outputting the following. Thanks!
? What would you like the user model to be called? Press <enter> for [user] > - Now setting up devise with user model name 'user':
generate devise
invoke active_record
create db/migrate/20120825075751_add_devise_to_users.rb
insert app/models/user.rb
route devise_for :users
- Now you'll need an initializer...
create config/initializers/rails_admin.rb
/home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activerecord-3.2.8/lib/active_record/reflection.rb:385:in `block in source_reflection': undefined method `klass' for nil:NilClass (NoMethodError)
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activerecord-3.2.8/lib/active_record/reflection.rb:385:in `collect'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activerecord-3.2.8/lib/active_record/reflection.rb:385:in `source_reflection'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activerecord-3.2.8/lib/active_record/reflection.rb:375:in `rescue in foreign_key'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activerecord-3.2.8/lib/active_record/reflection.rb:373:in `foreign_key'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/adapters/active_record.rb:259:in `association_foreign_key_lookup'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/adapters/active_record.rb:71:in `block in associations'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/adapters/active_record.rb:64:in `map'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/adapters/active_record.rb:64:in `associations'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/abstract_model.rb:29:in `block (2 levels) in polymorphic_parents'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/abstract_model.rb:28:in `each'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/abstract_model.rb:28:in `block in polymorphic_parents'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/abstract_model.rb:27:in `tap'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/abstract_model.rb:27:in `polymorphic_parents'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/adapters/active_record.rb:222:in `association_model_lookup'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/adapters/active_record.rb:69:in `block (2 levels) in associations'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/config/fields/types/polymorphic_association.rb:49:in `call'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/config/fields/types/polymorphic_association.rb:49:in `associated_model_config'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/config/fields/types/polymorphic_association.rb:19:in `block in <class:PolymorphicAssociation>'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/config/configurable.rb:68:in `instance_eval'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/config/configurable.rb:68:in `block in register_instance_option'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/rails_admin/config/configurable.rb:42:in `block in register_instance_option'
from (erb):86:in `block (2 levels) in template'
from (erb):85:in `map'
from (erb):85:in `block in template'
from (erb):82:in `map'
from (erb):82:in `template'
from /home/funkdified/.rvm/rubies/ruby-1.9.3-p125-HEAD/lib/ruby/1.9.1/erb.rb:838:in `eval'
from /home/funkdified/.rvm/rubies/ruby-1.9.3-p125-HEAD/lib/ruby/1.9.1/erb.rb:838:in `result'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:111:in `block in template'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `call'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/create_file.rb:54:in `render'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/create_file.rb:63:in `block (2 levels) in invoke!'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/create_file.rb:63:in `open'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/create_file.rb:63:in `block in invoke!'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:133:in `call'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:133:in `invoke_with_conflict_check'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/create_file.rb:61:in `invoke!'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions.rb:95:in `action'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/create_file.rb:26:in `create_file'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/actions/file_manipulation.rb:110:in `template'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/rails_admin-0.0.5/lib/generators/rails_admin/install_generator.rb:59:in `install'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/railties-3.2.8/lib/rails/generators.rb:171:in `invoke'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/railties-3.2.8/lib/rails/commands/generate.rb:12:in `<top (required)>'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
from /home/funkdified/.rvm/gems/ruby-1.9.3-p125-HEAD#rails323/gems/railties-3.2.8/lib/rails/commands.rb:29:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I figured it out. I installed devise first to debug and found it was an issue with my existing User model. I needed to drop the User table and start over.

Resources