Hello, I''m trying to use command rake db:migrate, but in MySQL I continuous get an empty set and I do know why. #/db/seeds.rb User.create(username: "lorenz", password: "mypass", admin: true) When I run: rake db:seed RAILS_ENV=development --trace I received: ** Invoke db:seed (first_time) ** Execute db:seed ** Invoke db:abort_if_pending_migrations (first_time) ** Invoke environment (first_time) ** Execute environment ** Invoke db:load_config (first_time) ** Execute db:load_config ** Execute db:abort_if_pending_migrations and my database keep empty. The migration is new and it works. Thanks to all. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 7 May 2013 11:18, Lorenz Blackbird <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hello, > > I''m trying to use command rake db:migrate, but in MySQL I continuous get > an empty set and I do know why. > > #/db/seeds.rb > User.create(username: "lorenz", password: "mypass", admin: true) > > When I run: > rake db:seed RAILS_ENV=development --trace > > I received: > ** Invoke db:seed (first_time) > ** Execute db:seed > ** Invoke db:abort_if_pending_migrations (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Invoke db:load_config (first_time) > ** Execute db:load_config > ** Execute db:abort_if_pending_migrations > > and my database keep empty. > > The migration is new and it works.What do you see if you run rake db:migrate Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Colin Law wrote in post #1108068:> On 7 May 2013 11:18, Lorenz Blackbird <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> >> and my database keep empty. >> >> The migration is new and it works. > > What do you see if you run > rake db:migrate > > ColinConsole viewed the migration of all the tables. The application works good and Active Record also, because I can read/write on database thorugh console and application interface. I''m only searching a simple way to populate database when I take the decision to re-generate a "clean" database. Thanks. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 8 May 2013 08:13, Lorenz Blackbird <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Colin Law wrote in post #1108068: >> On 7 May 2013 11:18, Lorenz Blackbird <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>> >>> and my database keep empty. >>> >>> The migration is new and it works. >> >> What do you see if you run >> rake db:migrate >> >> Colin > > Console viewed the migration of all the tables. The application works > good and Active Record also, because I can read/write on database > thorugh console and application interface. > > I''m only searching a simple way to populate database when I take the > decision to re-generate a "clean" database.So what do you see when you run rake db:migrate? Please copy/paste the result. Also then please run rake db:seed and copy/paste the result here. Also paste the complete db/seeds.rb and anything added to development.log by the running of rake db:seed. Please include the command invocation in the pasted result. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Colin Law wrote in post #1108191:> On 8 May 2013 08:13, Lorenz Blackbird <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>> Colin >> >> Console viewed the migration of all the tables. The application works >> good and Active Record also, because I can read/write on database >> thorugh console and application interface. >> >> I''m only searching a simple way to populate database when I take the >> decision to re-generate a "clean" database. > > So what do you see when you run rake db:migrate? Please copy/paste > the result. Also then please run rake db:seed and copy/paste the > result here. Also paste the complete db/seeds.rb and anything added > to development.log by the running of rake db:seed. Please include the > command invocation in the pasted result. > > ColinI fixed it. I forgot to have put a validation on user and that blocked the creation. Thank you so much Colin for time spent to me. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Maybe Matching Threads
- anyone able to explain logic behind "rake spec" startup (e.g. db:test:prepare => abort_if_pending_migration => invoke environment => etc etc)
- Rake Aborted wont Migrate mysql
- NoMethodError with rake db:migrate
- "rake test" works but "rake test:units" fails
- rake spec - no output