Rake migrate error: SQLexception

When i try to migrate my db, it gives the following error:
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
SQLite3::SQLException: no such table: users: SELECT * FROM “users”
D:/Irails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/conn
ection_adapters/abstract_adapter.rb:227:in log' D:/Irails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/conn ection_adapters/sqlite_adapter.rb:172:inexecute’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/conn
ection_adapters/sqlite_adapter.rb:418:in catch_schema_changes' D:/Irails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/conn ection_adapters/sqlite_adapter.rb:172:inexecute’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/conn
ection_adapters/sqlite_adapter.rb:321:in select' D:/Irails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/conn ection_adapters/abstract/database_statements.rb:7:inselect_all_without_query_c
ache’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/conn
ection_adapters/abstract/query_cache.rb:62:in select_all' D:/Irails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/base .rb:665:infind_by_sql’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/base
.rb:1582:in find_every' D:/Irails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/base .rb:619:infind’
C:/diederik/prails/zwemschool/config/initializers/task_scheduler.rb:6
D:/Irails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/de
pendencies.rb:171:in load_without_new_constant_marking' D:/Irails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/de pendencies.rb:171:inload’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/de
pendencies.rb:547:in new_constants_in' D:/Irails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/de pendencies.rb:171:inload’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/initializer.rb:622:in
lo ad_application_initializers' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/initializer.rb:621:inea
ch’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/initializer.rb:621:in
lo ad_application_initializers' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/initializer.rb:176:inpr
ocess’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/initializer.rb:113:in
se nd' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/initializer.rb:113:inru
n’
C:/diederik/prails/zwemschool/config/environment.rb:13
D:/Irails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_orig inal_require' D:/Irails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’

D:/Irails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/de
pendencies.rb:182:in require' D:/Irails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/de pendencies.rb:547:innew_constants_in’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/de
pendencies.rb:182:in require' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rails-2.3.11/lib/tasks/misc.rake:4 D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:incall’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
execute' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:ineach’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
execute' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:ininvoke_with
_call_chain’
D:/Irails/ruby/lib/ruby/1.8/monitor.rb:242:in synchronize' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:ininvoke_with
_call_chain’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in
invoke_prer equisites' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:ineach’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in
invoke_prer equisites' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:ininvoke_with
_call_chain’
D:/Irails/ruby/lib/ruby/1.8/monitor.rb:242:in synchronize' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:ininvoke_with
_call_chain’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in
invoke' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:ininvoke_tas
k’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
`top_level’

D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
each' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level’

D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
standard_e xception_handling' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:intop_level’

D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in
run' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:instandard_e
xception_handling’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in
run' D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 D:/Irails/ruby/bin/rake:19:inload’
D:/Irails/ruby/bin/rake:19

my app uses the following gems:

authlogic 2.1.6
declarative authorization 0.5.2
redcloth 4.2.7
rufus-scheduler 2.0.9

Can anyone see what is going wrong, do i need to post more info?

On 3 May 2011 13:44, Kelly P. [email protected] wrote:

When i try to migrate my db, it gives the following error:
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
SQLite3::SQLException: no such table: users: SELECT * FROM “users”

Any chance that at line 6 of config/initializers/task_scheduler.rb you
access Users before the users table has been created?

If so, what happens if you comment that line while you migrate to
create the table?

Hi kelly,
Kindly ensure that you are created the model named “User” before
migration
done…It seems to be you are not created the ‘user’ table.

On Tue, May 3, 2011 at 6:14 PM, Kelly P. [email protected]
wrote:

D:/Irails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/conn

D:/Irails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.11/lib/active_support/de
ad_application_initializers’
pr D:/Irails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in pendencies.rb:547:innew_constants_in’
D:/Irails/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
equisites’
invoke_witheach’
`run’


You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.

Thanks & Regards,

RAFI…,

In Every moment, thank God.

On 3 May 2011 14:00, Kelly P. [email protected] wrote:

You sir, saved my day. I should have looked more closely into the
errors.
Thank you very much.

No worries… they can be a pain to decipher sometimes - I’ve just
been banging my head against a bug myself which was waving itself in
my face! :slight_smile:

Michael P. wrote in post #996409:

Any chance that at line 6 of config/initializers/task_scheduler.rb you
access Users before the users table has been created?

If so, what happens if you comment that line while you migrate to
create the table?

You sir, saved my day. I should have looked more closely into the
errors.
Thank you very much.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs