NoPoint 今天学完 ruby on rails tutorial 第十一章,最后部署出了问题,哪位大佬可以指点一下

XixiAndRuby · 2018年01月14日 · 最后由 XixiAndRuby 回复于 2018年01月14日 · 331 次阅读

今天学完ruby on rails tutorial第十一章,准备在heroku部署的时候,出现了以下问题

$ heroku run rake db:populate --app enigmatic-peak-66666 ▸ heroku-cli: update available from 6.14.39-addc925 to 6.15.13-3dce47c Running rake db:populate on ⬢ enigmatic-peak-66666... up, run.1813 (Free)

rake aborted! ActiveRecord::RecordInvalid: Validation failed: Email has already been taken /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/validations.rb:57:in save!' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/attribute_methods/dirty.rb:41:insave!' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/transactions.rb:275:in block in save!' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/transactions.rb:326:inblock in with_transaction_returning_status' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in block in transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:210:inwithin_new_transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in transaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/transactions.rb:209:intransaction' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/transactions.rb:323:in with_transaction_returning_status' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/transactions.rb:275:insave!' /app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/validations.rb:41:in create!' /app/lib/tasks/sample_data.rake:4:inblock (2 levels) in ' /app/vendor/bundle/ruby/2.0.0/gems/rake-12.3.0/exe/rake:27:in <top (required)>' /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:inload' /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in kernel_load' /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:inrun' /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in exec' /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:inrun' /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in invoke_command' /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:indispatch' /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in dispatch' /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:instart' /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in start' /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.15.2/exe/bundle:30:inblock in ' /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in with_friendly_errors' /app/vendor/bundle/ruby/2.0.0/gems/bundler-1.15.2/exe/bundle:22:in' /app/bin/bundle:3:in load' /app/bin/bundle:3:in

' Tasks: TOP => db:populate (See full trace by running task with --trace)

此贴已暂时被屏蔽!

以下几种情况的帖子可能会被屏蔽:

  1. 标题/正文描述不清不楚;
  2. 无意义的发帖;
  3. 存在广告嫌疑;
  4. 招聘信息描述不清楚,未按照招聘节点的要求发帖,或职位信息不符合社区用户群需求;
  5. 新注册的帐号发布产品推广贴是不允许的哦,付出和回报是相等的,当然如果你的产品确实非常有意思,或是和 Ruby 有关的东西,是不会进入这个栏目的。
  6. 太过弱的提问会被直接转移到此节点,请在提问前多尝试,多搜索;
  7. 理论上,不允许发布 QQ 群、微信群之类讨论群。

如果你发现你的帖子被屏蔽,请自我检查反省,并修改帖子内容。


招聘贴被屏蔽原因

警告: 以后招聘贴不符合要求,直接屏蔽,管理员不再回复,如认真阅读,继续新发同样格式的贴,将会被禁用账号!

  • 排版请按 Ruby China 的 Markdown 格式要求,具体请认真阅读: 排版指导,并参考 这篇招聘 的排版;
  • 招聘内容过少,缺少公司介绍,产品介绍,职位介绍,或待遇,工作地,联系方式等必要信息;
  • 重复发帖(一家公司每月限制只能发一次招聘);
  • 专业不对口(个别不对口,但有特点的,我们会放过);

如果你有时间,请阅读 招聘栏目详细说明


学会如何合理提问,请阅读:https://ruby-china.org/topics/24325

当你修改好以后,可以回帖 @huacnlee@Rei@lgn21st 任何一人,我们将会审核,通过以后才可恢复到其他节点。

注!多次发现广告嫌疑的帐号,将会被禁用帐号。

共收到 1 条回复

学习十一章的过程中,执行bundle exec rake db:populate 没有出现问题,但是学完上传到heroku时出现了ActiveRecord::RecordInvalid: Validation failed: Email has already been taken

XixiAndRuby 关闭了讨论 01月14日 17:40
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册