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 6249555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:15:39+00:00 2026-05-24T13:15:39+00:00

I have the following code in my seeds.rb file in a jruby 1.6.3 rails

  • 0

I have the following code in my seeds.rb file in a jruby 1.6.3 rails 3.1 project which I invoke with rake db:seed

Role.destroy_all
User.destroy_all

["admin", "standard"].each do |role|
  Role.find_or_create_by_name(role)
end

if User.find_by_email("dagda1@scotalt.net").nil?
  user = User.new
  user.email = "dagda1@scotalt.net"
  user.password = "Passw0rd"
  user.password_confirmation = "Passw0rd"
  user.role = Role.find_by_name("admin")
  user.save!
end

if User.find_by_email("fiblevins@hotmail.com").nil?
  user = User.new
  user.email = "fiblevins@hotmail.com"
  user.password = "bonjovi5"
  user.password_confirmation = "bonjovi5"
  user.role = Role.find_by_name("standard")
  user.save!
end

When I run rake db:seed –trace , I get the following stack trace:

** Invoke db:seed (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:seed
rake aborted!
wrong number of arguments (3 for 2)
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activerecord-3.1.0.rc5/lib/active_record/base.rb:470:in `find_by_sql'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activerecord-3.1.0.rc5/lib/active_record/relation.rb:111:in `to_a'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activerecord-3.1.0.rc5/lib/active_record/relation.rb:289:in `destroy_all'
org/jruby/RubyBasicObject.java:1684:in `__send__'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activerecord-3.1.0.rc5/lib/active_record/base.rb:438:in `destroy_all'
/Users/paulcowan/projects/leadcapturer/db/seeds.rb:3:in `(root)'
org/jruby/RubyKernel.java:1073:in `load'
/Users/paulcowan/projects/leadcapturer/db/seeds.rb:233:in `load'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activesupport-3.1.0.rc5/lib/active_support/dependencies.rb:223:in `load_dependency'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activesupport-3.1.0.rc5/lib/active_support/dependencies.rb:639:in `new_constants_in'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activesupport-3.1.0.rc5/lib/active_support/dependencies.rb:638:in `new_constants_in'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activesupport-3.1.0.rc5/lib/active_support/dependencies.rb:223:in `load_dependency'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activesupport-3.1.0.rc5/lib/active_support/dependencies.rb:233:in `load'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/railties-3.1.0.rc5/lib/rails/engine.rb:487:in `load_seed'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activerecord-3.1.0.rc5/lib/active_record/railties/databases.rake:299:in `(root)'
org/jruby/RubyProc.java:256:in `call'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
org/jruby/RubyArray.java:1603:in `each'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/Users/paulcowan/.rvm/rubies/jruby-1.6.3/lib/ruby/1.9/monitor.rb:201:in `mon_synchronize'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
org/jruby/RubyArray.java:1603:in `each'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/rake-0.9.2/bin/rake:32:in `(root)'
org/jruby/RubyKernel.java:1073:in `load'
/Users/paulcowan/.rvm/gems/jruby-1.6.3/bin/rake:19:in `(root)'
Tasks: TOP => db:seed

THis used to work, can anyone make any sense of what is going on? My gemfile looks like this:

source 'http://rubygems.org'
source 'http://gems.engineyard.com'

gem 'rails',               '~> 3.1.0.rc5'
gem 'sass-rails'
gem 'compass', git: 'https://github.com/chriseppstein/compass.git',branch: 'rails31'
gem 'fancy-buttons'
gem 'haml'
gem 'authlogic', :git => 'https://github.com/AndreasWurm/authlogic.git'#, :branch => 'rails3'
gem 'nokogiri'
gem 'bundler'
gem 'resque'              
gem 'resque-meta'        
gem 'jquery-rails'     
gem 'rake'#, '~> 0.8.7'          
gem 'eventmachine'
gem 'em-websocket'
gem 'json'
gem 'coffee-script'
gem 'uglifier'

platforms :jruby do
    gem 'activerecord-jdbc-adapter'
    gem 'activerecord-jdbcsqlite3-adapter'
    gem 'jruby-openssl'
    gem 'jdbc-mysql'
    gem 'jruby-rack'
    gem 'warbler'
    #gem 'glassfish', '1.0.3.dev'
end

group :test, :development do
  platforms :jruby do
    gem 'jdbc-sqlite3', :require => false
    gem 'fastercsv'
    gem 'ruby-debug'
  end

  platforms :ruby do
    gem 'sqlite3-ruby', :require => 'sqlite3'
  end

  gem 'mocha'
  gem 'factory_girl'
  gem 'fakeweb'
  gem 'shoulda', :require => 'shoulda'
end

Any help greatly appreciated.

  • 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-24T13:15:40+00:00Added an answer on May 24, 2026 at 1:15 pm

    This is a problem with the current version of activerecord-jdbc (1.1.3 as we speak).

    Add this to your gem file and you should be good to go :

    gem "activerecord-jdbc-adapter", 
        :git => "https://github.com/nicksieger/activerecord-jdbc-adapter.git"
    

    Don’t forget to switch back to the gem repo when activerecord-jdbc 1.1.4 is released.

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

Sidebar

Related Questions

I have the following code which works perfectly fine in my php file and
I have a seed file with the following code within it: 300.times do #
I have following code for updating user's column public void UpdateLastModifiedDate(string username) { using
I have the following code for managing file download through django. def serve_file(request, id):
I have the following code which should make drawFrame be called every frame but
In my Maven project, I have the following code in the main method: FileInputStream
Why am I not allow to rake my seeds.rb file when I have the
I have the following code which works well on another server. The problem is
I have the following code which seems to throw a Invalid cross-thread access. and
So I have the following code to check for the text file called Doctors.txt

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.