heroku rake db:migrate失败 [英] heroku rake db:migrate fails

查看:117
本文介绍了heroku rake db:migrate失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误:

[app(master)] $ heroku rake db:migrate

耙子中止了!

Heroku :: Rails:Module/app/Rakefile:7的未定义方法"root"

undefined method `root' for Heroku::Rails:Module /app/Rakefile:7

(通过使用--trace运行任务来查看完整的跟踪信息)(在/app中)

(See full trace by running task with --trace) (in /app)

我无法弄清错误提示(heroku rake db:migrate --trace 给出"Invalid Option --trace"),而我不认为这与众所周知的"heroku不使用sqlite3"有关.问题.

I can't figure out how to run trace as suggested by the error (heroku rake db:migrate --trace gives "Invalid Option --trace"), and I don't believe this is related to the well-known "heroku doesn't use sqlite3" issue.

我的Rakefile如下:

My Rakefile is as follows:

require File.expand_path('../config/application', __FILE__)
require 'rake'

SampleApp::Application.load_tasks

推荐答案

自解决

最终,该问题的解决方案分为两个阶段:

Ultimately, the solution to this problem was found in 2 stages:

1)我发现我的rvm gemset列表为空.不知道是什么时候或如何发生的,因为它是在之前设置的.这可能与我弄乱RubyMine设置有关,该设置使您可以手动调整Ruby SDK和Gems.我做了一个rvm gemset来设置正确的集合,然后安装rvm gemset并更新rvm gemset来将所有正确的gem加载到环境中.老实说,我不完全了解这里发生的事情以及它与手动gem install命令之间的相互关系,因此我很可能通过对RVM的微不足道将整个事情搞砸了.

1) I discovered that my rvm gemset list was blank. Not sure when or how this happened, because it was set before. It may be related to me messing around with RubyMine settings, which allow you to tweak the Ruby SDK and Gems manually. I did an rvm gemset to set the correct set, and then rvm gemset install and rvm gemset update to get all the proper gems loaded into the environment. I'll be honest, I don't fully understand what's going on here and how it inter-relates with the manual gem install commands, so it's very possible I mucked the whole thing up through my meager understanding of RVM.

这时,heroku rake db:migrate仍然失败,并出现相同的错误,但是:

At this point, heroku rake db:migrate still failed with the same error, however:

2)我的Heroku凭证以某种方式断开了连接.我猜是Git&因此,Rake失败了.同样,我对这里的后果不完全了解,但是最终,解决方案就在Heroku设置页面的正面.重新输入heroku创建后,将再次正确设置我现有的凭据,并且rake停止失败.

2) My Heroku credentials had somehow become disconnected. I'm guessing Git & Rake were failing due to that. Again, I don't fully understand the ramifications here, but ultimately, the solution was right in front of my face on the Heroku Setup page. Once I retyped heroku create, my existing credentials were set properly again, and rake stopped failing.

摘要

我有点想删除或忘记这篇文章(因为我已经自我修复),但是我想我不是唯一会因此类错误而受挫的Rails菜鸟.我猜想它们(错误)是由我在系统(尤其是RubyMine)中摸索所致,试图弄清所有事物是如何互连的.由于对于新的Ruby/Rails程序员来说,诸如此类问题的答案可能并不明显,因此我将不再赘述.

I was half tempted to just delete or forget about this post (since I self-fixed), but I'm guessing I'm not the only Rails noob that will be frustrated by errors like these. I'm guessing they (the errors) were caused by me fumbling around the system (especially RubyMine) trying to figure out how everything was interconnected. Since the answers to problems such as these are probably not self evident to new Ruby/Rails programmers, I'll leave this up.

这篇关于heroku rake db:migrate失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆