Now i am upgrade the rails 3.0.7 to rails 3.1 pre version. When i am creating a sample project it works fine. After creating a scaffold i am try to migrate, but it gives me the rake aborted! message.
Here my code
rails g scaffold product name:string price:decimal category:string
invoke active_record
create db/migrate/20110517090853_create_products.rb
create app/models/product.rb
invoke test_unit
create test/unit/product_test.rb
create test/fixtures/products.yml
route resources :products
invoke scaffold_controller
create app/controllers/products_controller.rb
invoke erb
create app/views/products
create app/views/products/index.html.erb
create app/views/products/edit.html.erb
create app/views/products/show.html.erb
create app/views/products/new.html.erb
create app/views/products/_form.html.erb
invoke test_unit
create test/functional/products_controller_test.rb
invoke helper
create app/helpers/products_helper.rb
invoke test_unit
create test/unit/helpers/products_helper_test.rb
create app/assets/stylesheets/scaffold.css.scss
invoke assets
create app/assets/javascripts/products.js.coffee
create app/assets/stylesheets/products.css.scss
rake db:migrate
== CreateProducts: migrating =================================================
-- create_table(:products)
-> 0.0053s
== CreateProducts: migrated (0.0054s) ========================================
rake aborted!
An error has occurred, all later migrations canceled:
undefined method `rows' for nil:NilClass
(See full trace by running task with --trace)
I am using ruby 1.9.2 and xampp.
Can any one know what is the problem?
I had the same problem using mysql2 v0.2.6 as database adapter.
I've tried to solve it updating mysql2 to latest version 0.3.2, but I could not compile this gem on Windows.
But I still believe that recent version of mysql2 might work.
Currently I use "pg" gem as postgres adapter for DB and it works fine with Rails 3.1.pre
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With