small medium large xlarge

Generic-user-small
19 Mar 2010, 08:47
Thiel Chang (3 posts)

Hi,

I am learning Rails from “Agile Web Development with Rails” (third edition) by implementing the Depot example. This is an excellent book to learn Rails. However, I have a problem in the chapter 14, Testing; page 208, in which I had to run the command: db:test:prepare. It gave the following result;

 in C:/MyProjects/dev/webshop)
 rake aborted!
 Task not supported by 'jdbcmysql'
 rake aborted!
 invalid meta-code syntax: /C:\MyProjects\dev\webshop\Rakefile/

I am using the Netbeans 6.8 IDE with WeBrick as the application server.

Can anyone give me a clue how to solve that problem?

Thanks in advance,

Thiel

Generic-user-small
22 Mar 2010, 22:59
Thiel Chang (3 posts)

Hi,

After puzzling some time I solved this problem as follows:

1) Run the rake task: db:test:prepare with the parameter RAILS_ENV=test 2) Run the rake task: db:migrate with the parameter RAILS_ENV=test 3) Go to Service (in Netbeans 6.8) and refresh the test database ( then you’ll see the tables in the test database) 4) After these steps, I still had a problem because the total_price was null. I corrected that by setting total_price = 10 (you can set your own values)in the file Test/fixtures/line_items.yml 5) I ran the product_test.rb file 6) All the product tests succeeded.

Thiel

You must be logged in to comment