Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6689451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:31:14+00:00 2026-05-26T05:31:14+00:00

A previously-working Rails 3.1 app is now failing to deploy. The Capistrano deploy:assets:precompile task

  • 0

A previously-working Rails 3.1 app is now failing to deploy. The Capistrano deploy:assets:precompile task encounters an error “Could not find table 'users'“.

I have used rake --trace to pin this error down on a newly-added named scope in the users model:

scope :find_by_skill_offered, lambda { |skill_id|
  joins(:skills).where("user_skills.offered = ? AND skills.id = ?", 'true', skill_id)
}

It seems to me that the rake task may be trying to execute the lambda, before the database is linked, and therefore failing.

This sounds like a similar problem to this problem with factory_girl, i.e. code being executed before the database exists, but I can’t understand why a lambda would be executed before it is actually called.

The stack trace shows the construction of Devise routes in there as well, so maybe it’s related to that, but it seems strange that routing code is being run as part of deploy:assets:precompile, or am I missing something about how the pipeline works?

Thanks in advance.

Update:

This also occurs with local rake assets:precompile (I normally only build assets on the server).

Full error output and trace:

  * 18:47:58 == Currently executing `deploy:assets:precompile'
  * executing "cd /home/backscratchers/development/backscratchers/releases/20111010174747 && rake --trace RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
  servers: ["87.106.100.151"]
  [87.106.100.151] executing command
*** [err :: 87.106.100.151] ** Invoke assets:precompile (first_time)
*** [err :: 87.106.100.151] ** Execute assets:precompile
*** [err :: 87.106.100.151] ** Invoke environment (first_time)
*** [err :: 87.106.100.151] ** Execute environment
*** [err :: 87.106.100.151] rake aborted!
*** [err :: 87.106.100.151] Could not find table 'users'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/sqlite_adapter.rb:387:in `table_structure'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/sqlite_adapter.rb:270:in `columns'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `block (2 levels) in initialize'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:185:in `with_connection'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:92:in `block in initialize'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/base.rb:706:in `yield'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/base.rb:706:in `default'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/base.rb:706:in `columns'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/base.rb:722:in `column_names'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/base.rb:735:in `column_methods_hash'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/base.rb:1101:in `all_attributes_exists?'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/base.rb:886:in `respond_to?'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/named_scope.rb:193:in `valid_scope_name?'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.0/lib/active_record/named_scope.rb:175:in `scope'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/releases/20111010174747/app/models/user.rb:6:in `<class:User>'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/releases/20111010174747/app/models/user.rb:1:in `<top (required)>'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:348:in `require_or_load'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:489:in `load_missing_constant'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:181:in `block in const_missing'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:179:in `each'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:179:in `const_missing'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/inflector/methods.rb:124:in `block in constantize'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/inflector/methods.rb:123:in `each'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/inflector/methods.rb:123:in `constantize'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:528:in `block in initialize'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:550:in `yield'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:550:in `default'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:550:in `[]'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:595:in `constantize'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/devise-1.4.5/lib/devise.rb:259:in `get'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/devise-1.4.5/lib/devise/mapping.rb:101:in `to'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/devise-1.4.5/lib/devise/mapping.rb:96:in `modules'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/devise-1.4.5/lib/devise/mapping.rb:113:in `routes'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/devise-1.4.5/lib/devise/mapping.rb:82:in `initialize'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/devise-1.4.5/lib/devise.rb:289:in `new'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/devise-1.4.5/lib/devise.rb:289:in `add_mapping'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/devise-1.4.5/lib/devise/rails/routes.rb:191:in `block in devise_for'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/devise-1.4.5/lib/devise/rails/routes.rb:190:in `each'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/devise-1.4.5/lib/devise/rails/routes.rb:190:in `devise_for'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/releases/20111010174747/config/routes.rb:20:in `block in <top (required)>'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/routing/route_set.rb:257:in `instance_exec'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/routing/route_set.rb:257:in `eval_block'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/action_dispatch/routing/route_set.rb:234:in `draw'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/releases/20111010174747/config/routes.rb:1:in `<top (required)>'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `block in load'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:225:in `load_dependency'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/application/routes_reloader.rb:29:in `block in load_paths'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/application/routes_reloader.rb:29:in `each'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/application/routes_reloader.rb:29:in `load_paths'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/application/routes_reloader.rb:13:in `reload!'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/application/routes_reloader.rb:7:in `block in initialize'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/file_update_checker.rb:32:in `call'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/application/finisher.rb:63:in `block (2 levels) in <module:Finisher>'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/application/finisher.rb:64:in `call'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/application/finisher.rb:64:in `block in <module:Finisher>'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `instance_exec'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `run'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:50:in `block in run_initializers'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `each'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `run_initializers'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/application.rb:92:in `initialize!'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/releases/20111010174747/config/environment.rb:5:in `<top (required)>'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/application.rb:78:in `require_environment!'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/railties-3.1.0/lib/rails/application.rb:189:in `block (2 levels) in initialize_tasks'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
*** [err :: 87.106.100.151] /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
*** [err :: 87.106.100.151] /home/backscratchers/development/backscratchers/shared/bundle/ruby/1.9.1/gems/actionpack-3.1.0/lib/sprockets/assets.rake:11:in `block (2 levels) in <top (required)>'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
*** [err :: 87.106.100.151] /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290@global/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
*** [err :: 87.106.100.151] /usr/local/rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
*** [err :: 87.106.100.151] Tasks: TOP => environment
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:31:15+00:00Added an answer on May 26, 2026 at 5:31 am

    I have solved this by replacing the lambda function with a class method:

    def self.find_by_skill_offered(skill_id)
      joins(:skills).where("user_skills.offered = ? AND skills.id = ?", 'true', skill_id)
    }
    

    It seems this is the preferred approach for Rails 3.1 and beyond.

    In case it was a bug in Devise, I created an issue on GitHub, and apparently using a name like find_by_* may have been screwing things up.

    I like using the same naming as Rails autogenerated find functions (although really this is a find_all_by_* because it returns an array), but as this seems to be dodgy, perhaps it should be avoided.

    Sorry not to have definitive answers on the error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A previously working Ecplise now gives me the error Java Virtual Machine Launcher Could
I'm using attr_encrypted in my rails app and it is not working as expected.
I previously worked a lot with Java and now I am working more with
I have a rails blog app that was working well.. However, I did some
I replaced my OS on my PC with a new one. Previously assets:precompile is
I've just been given the task of getting a previously working version of an
We upgraded WebSphere Application Server to V7 and previously working applications now get 2035
My rails app seems to break when it answers on www.example.com, it previously was
I had a RoR app working fun under Fedora14, I upgraded to Fedora16 and
I am creating a small rails app for personal use and would like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.