Ruby on Rails error message is very long -
i purposely made mistake in migration file show kind of error get.
== 20150321034322 alterusers: migrating ======================================= -- rename_table("users", "admin_users") -> 0.0023s -- add_column("admin_users", "username", :string, {:limit=>25, :after=>"email"}) -> 0.0198s -- change_column("admin_users", "email", :string, {:limit=>100}) -> 0.0162s -- rename_column("admin_users", "broken", "hashed_password") rake aborted! standarderror: error has occurred, later migrations canceled: no such column: admin_users.broken/library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:483:in `column_for' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:759:in `rename_column_sql' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:521:in `rename_column' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:662:in `block in method_missing' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:632:in `block in say_with_time' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:632:in `say_with_time' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:652:in `method_missing' /users/my/desktop/sites/simple_cms/db/migrate/20150321034322_alter_users.rb:6:in `up' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:609:in `exec_migration' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:590:in `block (2 levels) in migrate' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:589:in `block in migrate' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:588:in `migrate' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:765:in `migrate' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:995:in `block in execute_migration_in_transaction' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:1043:in `ddl_transaction' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:994:in `execute_migration_in_transaction' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:956:in `block in migrate' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:952:in `each' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:952:in `migrate' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:820:in `up' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:798:in `migrate' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:137:in `migrate' /library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>' tasks: top => db:migrate (see full trace running task --trace)
shouldn't error message instead?
== 20150321034322 alterusers: migrating ======================================= -- rename_table("users", "admin_users") -> 0.0023s -- add_column("admin_users", "username", :string, {:limit=>25, :after=>"email"}) -> 0.0198s -- change_column("admin_users", "email", :string, {:limit=>100}) -> 0.0162s -- rename_column("admin_users", "broken", "hashed_password") rake aborted! standarderror: error has occurred, later migrations canceled: no such column: admin_users.broken/library/ruby/gems/2.0.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract_adapter.rb:483:in `column_for'
it depressing see long error message lol. have feeling maybe did not install rails correctly. please guide.
what seeing called stack trace. simplest of errors, can used track down issue is. there's nothing wrong installation, useful information!
as can see, in full error, 8 lines in, tells file, , line on.
/users/my/desktop/sites/simple_cms/db/migrate/20150321034322_alter_users.rb:6:in `up'
if error wasn't on purpose, you'd grateful little bit of information track down!
Comments
Post a Comment