【发布时间】:2012-04-24 09:01:55
【问题描述】:
我在将 Rail 应用程序部署到 Heroku 时遇到了困难。我真的很感激一个想法清单来解决这个问题,我已经用尽了我的想法正在诉诸于拔掉我的头发!
短篇小说: heroku run rake db:migrate 产生错误:
Running rake db:migrate attached to terminal... up, run.1
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
rake aborted!
syntax error on line 7, col 11: `'
这看起来应该很容易修复。问题是,我没有任何插件!
长篇大论:我正准备重新部署 Rails 应用程序以进行暂存。这是 Heroku 上的 Rails 3.0 应用程序,我刚刚完成了一次重大升级,包括升级到 Rails 3.2、Ruby 1.9.2、删除插件和重大重写。我现在正在尝试推送到 Heroku 的 cedar 堆栈以进行更多测试。
这几天我一直在努力解决这个问题,并一直认为我正在取得进展,但后来感到失望。最近,我认为我的 git 存储库没有对齐,并且 Heroku 远程包含这些插件的旧提交。我不再认为是这种情况。 (我确实想检查一下,但由于这个错误,我无法进入 Heroku 控制台来验证文件结构)。
确认一下,我的 vendor/plugins 文件夹在我的本地 master 和远程 github repo 上肯定是空的。它在远程 Heroku 分支上应该是空的,因为我已经推送了所有更新(我什至用新的远程名称创建了一个完全空白的应用程序来测试,但得到了同样的错误)。我说 vendor/plugins 是空的,但实际上 vendor/plugins 是不存在的,在我删除其中的插件后已被完全删除。
我确实在早期版本的应用程序中安装了两个插件:HABTM 复选框和 fancybox-rails。这些都已被卸载rails plugin remove <<plugin name>>。
我检查了错误/app/rakefile:7 中引用的文件,但看不出这行MyApp::Application.load_tasks 有什么问题。
如果我尝试启动 heroku 控制台,错误会略有不同,并引用 /app/config/environment.rb:5)。我在这里也看不到任何东西MyApp::Application.initialize!
我已经通过所有可能的地方寻找这些插件的任何残余或旧的require 语句,但一无所获。
我真的很感激任何关于我可以在哪里寻找的想法。如果需要,我可以提供更多信息,我只是不确定现阶段有什么用处!
谢谢你帮我留头发!!
编辑
我正在添加错误中提到的 rakefile 的全部内容。我看不出这有什么问题。
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require 'rake'
MyApp::Application.load_tasks
【问题讨论】:
标签: ruby-on-rails heroku