El Dorado

A full-stack community web application written in Ruby/Rails
NoMethodError (undefined method `find' for Upload:Class): « El Dorado « almost effortless
 
Tue, 30 Sep 2008, 12:43pm #1
thorndike
New member
Registered: Sep, 2008
Last visit: Tue, 30 Sep 2008
Posts: 5

Hi. This app looks amazing. But I ran into troubles just from the start.

I read the README file and installed tzinfo gem. Are there any gems missing? I already have lots of them installed.

 NoMethodError in HomeController#index

undefined method `find' for Upload:Class

RAILS_ROOT: /Users/Thorndike/Sites/ed

app/controllers/home_controller.rb:11:in `index'
app/controllers/application.rb:32:in `set_timezone'
app/controllers/application.rb:27:in `get_settings'

Thanks for your advice.

Offline
Tue, 30 Sep 2008, 2:54pm #2
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 4 hours ago
Posts: 240

I'd suggest using the "master" on github:

http://github.com/trevorturk/el-dorado/tree/master

I'm not sure what the error you have is, but with the master version, you don't need any gems or anything - just the ability to run a regular old Rails app. Let me know if it continues and maybe I can help. That "find" method really should be defined, though, as it's something that comes with Rails itself :)

Offline
Tue, 30 Sep 2008, 3:04pm #3
thorndike
New member
Registered: Sep, 2008
Last visit: Tue, 30 Sep 2008
Posts: 5

Thanks for reply.
I tried againg with "master" trunk. But I still have the same problem. I uploaded my development.log. Maybe you can see what the problem is.

From script/console there is no problem using Upload.find at all. But running the app with a debugger for this special line brings up immediatly an error.

Offline
Tue, 30 Sep 2008, 3:09pm #4
thorndike
New member
Registered: Sep, 2008
Last visit: Tue, 30 Sep 2008
Posts: 5

I was able to add a user.
In the application everything works fine except the "Home" and "Files" section. Seems like AttachmentFu has a problem somewhere.

Here is another stacktrace from the Files-Section:

 NoMethodError in UploadsController#index

undefined method `paginate' for Upload:Class

RAILS_ROOT: /Users/Jan/Sites/war
Application Trace | Framework Trace | Full Trace

app/controllers/uploads_controller.rb:13:in `index'

vendor/rails/actionpack/lib/action_controller/base.rb:1162:in `send'
vendor/rails/actionpack/lib/action_controller/base.rb:1162:in `perform_action_without_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:580:in `call_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:573:in `perform_action_without_benchmark'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
vendor/rails/actionpack/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'
vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
vendor/rails/actionpack/lib/action_controller/base.rb:529:in `send'
vendor/rails/actionpack/lib/action_controller/base.rb:529:in `process_without_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:569:in `process_without_session_management_support'
vendor/rails/actionpack/lib/action_controller/session_management.rb:130:in `process'
vendor/rails/actionpack/lib/action_controller/base.rb:389:in `process'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:149:in `handle_request'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:107:in `dispatch'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `synchronize'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `dispatch'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:35:in `dispatch'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:76:in `process'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in `process'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:282:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in `each'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in `run'
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
vendor/rails/activesupport/lib/active_support/dependencies.rb:502:in `load'
vendor/rails/activesupport/lib/active_support/dependencies.rb:502:in `load'
vendor/rails/activesupport/lib/active_support/dependencies.rb:354:in `new_constants_in'
vendor/rails/activesupport/lib/active_support/dependencies.rb:502:in `load'
vendor/rails/railties/lib/commands/servers/mongrel.rb:64
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
vendor/rails/activesupport/lib/active_support/dependencies.rb:509:in `require'
vendor/rails/activesupport/lib/active_support/dependencies.rb:354:in `new_constants_in'
vendor/rails/activesupport/lib/active_support/dependencies.rb:509:in `require'
vendor/rails/railties/lib/commands/server.rb:39
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
script/server:3

Offline
Tue, 30 Sep 2008, 3:12pm #5
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 4 hours ago
Posts: 240

I think the problem is with this mongrel upload progress gem:

http://mongrel.rubyforge.org/ticket/33

Offline
Tue, 30 Sep 2008, 3:16pm #6
thorndike
New member
Registered: Sep, 2008
Last visit: Tue, 30 Sep 2008
Posts: 5

You're perfectly right. With "sudo gem uninstall mongrel_upload_progress" everything works now like a charm.
Thank you so much for your help!

Offline
Tue, 30 Sep 2008, 3:20pm #7
thorndike
New member
Registered: Sep, 2008
Last visit: Tue, 30 Sep 2008
Posts: 5

This link talks about: "A patch to move the Upload class into the Mongrel:: namespace would be acceptable"

So, maybe there is another way than uninstalling the upload_progress_gem which I need for another project.

Thanks in advance for an advice.

Offline
Tue, 30 Sep 2008, 3:47pm #8
Trevor
Administrator
Wait-ill-fix-it
Registered: Sep, 2005
Last visit: 4 hours ago
Posts: 240

You'd have to submit a patch to them, which is something I'd thought about doing but never gotten around to actually doing. I'm sure they'd appreciate it, and I would, too. It's very annoying that having that gem installed makes it a problem to create an Upload class.

Offline