Rake db:create fails and every other rake task

Okay, I’m trying really hard to get this to work. And it has worked
before. I have added tables to my database before but now it suddenly
doesn’t "know how to build task ‘db:create’, ‘db:drop’ or even
‘db:reset’.

I’ve updated to the latest ruby gems, latest rails, but these do not
solve the problem either.

I’ve checked the rake -T and can not locate any command called
‘db:create’, ‘db:drop’ or even ‘db:reset’ which I though I would find
there.

I even tried to do an ugly solution by inserting the table contents in
the schema, but it rendered that i had an error in my SQL syntax. I
can’t see why it would be my table that is wrong, but maybe somehow it’s
a possibillity, or?

create_table :portfolios, :force => true do |t|
t.column “parent_id”, :integer
t.column “content_type”, :string
t.column “filename”, :string
t.column “thumbnail”, :string
t.column “size”, :integer
t.column “width”, :integer
t.column “height”, :integer
t.column “user_id”, :interger
end

so i even tried to insert it manually in SQLyog, but there isn’t a
string value to select to insert into my table.

WHAT IS WROOONG?!

On Jan 31, 7:51 am, Dag S. [email protected]
wrote:

Okay, I’m trying really hard to get this to work. And it has worked
before. I have added tables to my database before but now it suddenly
doesn’t "know how to build task ‘db:create’, ‘db:drop’ or even
‘db:reset’.

What version of Rails is your app using, and is Rails frozen to your
app or is it using gems?

Are you running rake from the “root” of your application directory
tree?

What OS are you on?

Jeff
softiesonrails.com

Jeff C. wrote:

On Jan 31, 7:51�am, Dag S. [email protected]
wrote:

Okay, I’m trying really hard to get this to work. And it has worked
before. I have added tables to my database before but now it suddenly
doesn’t "know how to build task ‘db:create’, ‘db:drop’ or even
‘db:reset’.

What version of Rails is your app using,

Well, I ran it on “1.8.6-26 Final Release”, and everything worked until
today when I tried to add a new table with the migrate etc. Since it
didn’t work I assumed maybe there was some sort of new version out of
gems or even rails, so I followed the instructions for updating my gems
and rails
(http://weblog.rubyonrails.org/2007/12/19/trouble-installing-new-gems)

and is Rails frozen to your
app or is it using gems?
frozen? I don’t think it is. Hard to say right at the moment since I’m
writing from home, but I’ll get back about that in 8 hours. I’m using
gems as far as I know, didn’t know it was possible NOT to use gems…

Are you running rake from the “root” of your application directory
tree?

I’ve tried to run it from the “root” of my application, from the “db”
directory and migrate directory. All of which rendered the same error.

What OS are you on?

I’m running it on Windows XP

Jeff
softiesonrails.com

Thanks allot for the input, hope this makes it clearer about my problem.
//Dag S.

Sorry I forgot to include the link:

http://softiesonrails.com/2008/1/3/freezing-your-rails-application

Jeff

On Jan 31, 4:05Â pm, Dag S. [email protected]

On Jan 31, 4:05 pm, Dag S. [email protected]
wrote:

frozen? I don’t think it is. Hard to say right at the moment since I’m
writing from home, but I’ll get back about that in 8 hours. I’m using
gems as far as I know, didn’t know it was possible NOT to use gems…

Ah… well, when you upgrade rails, you’re also upgrading your
application to use the new version, which in some cases will cause
issues if you have an app written for Rails 1.x but you’ve now
suddenly upgraded to 2.0.

We’ve written an introductory article on what freezing is all about
here:

Are you running rake from the “root” of your application directory
tree?

I’ve tried to run it from the “root” of my application, from the “db”
directory and migrate directory. All of which rendered the same error.

Rake should always be run from the root, so it sounds like you have
something else wrong with the app.

Try this: what happens when you try:

ruby script\console

(again from the root of your application)

Do you get the Rails console started up? It should say “Loading
development environment” or something similar, then give you an irb-
style prompt (type “exit” to return to Windows).

I’m running it on Windows XP

Thanks allot for the input, hope this makes it clearer about my problem.

No problem! :slight_smile:

Some further background to what I’m doing with my application. I’ve
based it on RESTful authentication plugin, and built in file_column
plugin, and nothing else really. The error appeared the first time ever
after installing rMagick and the attachmen_fu plugin.

Ah… well, when you upgrade rails, you’re also upgrading your
application to use the new version, which in some cases will cause
issues if you have an app written for Rails 1.x but you’ve now
suddenly upgraded to 2.0.

Well, I’m sure I did NOT freeze my app(efter reading the article) ;D

Rake should always be run from the root, so it sounds like you have
something else wrong with the app.

I can only think of one change I’ve done to the gems and rails before I
decided to update it and that was installing rMagick and its
gems…could installing the rMagick gem screw up the other gems in some
odd way?

Try this: what happens when you try:

ruby script\console

The console starts up and says something like “Loading
development environment”

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