加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 私有方法`test’调用#

发布时间:2020-12-17 04:00:11 所属栏目:百科 来源:网络整理
导读:有没有人可以看看.我对此感到困惑.非常感谢你. [river@localhost demo04]$rake db:migrate --trace WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead. at /home/river/.rvm/gems/ruby-1.8.7-p
有没有人可以看看.我对此感到困惑.非常感谢你.

[river@localhost demo04]$rake db:migrate --trace
  WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
==  CreateProducts: migrating =================================================
-- create_table(:products)
rake aborted!
An error has occurred,all later migrations canceled:

private method `test' called for #<ActiveRecord::ConnectionAdapters::TableDefinition:0x7f2a8fb07c30>
./db/migrate//20120628020339_create_products.rb:5:in `up_without_benchmarks'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:104:in `create_table'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:445:in `create_table'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:346:in `send'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:346:in `method_missing'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:326:in `say_with_time'
/home/river/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/benchmark.rb:293:in `measure'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:326:in `say_with_time'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:342:in `method_missing'
./db/migrate//20120628020339_create_products.rb:3:in `up_without_benchmarks'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:280:in `send'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:280:in `migrate'
/home/river/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/benchmark.rb:293:in `measure'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:280:in `migrate'
(__DELEGATION__):2:in `__send__'
(__DELEGATION__):2:in `migrate'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:480:in `migrate'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:556:in `call'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:556:in `ddl_transaction'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:479:in `migrate'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:466:in `each'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:466:in `migrate'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:394:in `up'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/activerecord-2.2.2/lib/active_record/migration.rb:377:in `migrate'
/home/river/.rvm/gems/ruby-1.8.7-p358/gems/rails-2.2.2/lib/tasks/databases.rake:111
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/home/river/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/gems/rake-0.9.2.2/bin/rake:33
/home/river/.rvm/gems/ruby-1.8.7-p358@global/bin/rake:19:in `load'
/home/river/.rvm/gems/ruby-1.8.7-p358@global/bin/rake:19
/home/river/.rvm/gems/ruby-1.8.7-p358/bin/ruby_noexec_wrapper:14
Tasks: TOP => db:migrate

解决方法

我猜你的20120628020339_create_products.rb迁移有问题,可能你可能在那里使用关键字

如果您可以发布迁移文件代码,我们可能会帮助:)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读