I’m running into difficulties deploying a Rail app to Heroku. I’d really appreciate a check list of ideas to run through to sort this out, I’ve exhausted my ideas are am resorting to pulling my hair out!
The short story: heroku run rake db:migrate generates an error:
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: `'
This looks like it should be pretty easy to fix. The problem is, I don’t have any plugins!
The long story: I’m getting ready to redeploy a Rails app for staging. This was a Rails 3.0 app on Heroku, which I’ve just completed a major upgrade on, including upgrade to Rails 3.2, Ruby 1.9.2, removal of plugins, and major rewrite. I’m now trying to push to Heroku’s cedar stack to do some more testing.
I’ve been trying to work through this issue for a couple of days, and keep thinking I’m getting somewhere, but am then disappointed. Most recently I thought that my git repos were out of alignment and that the Heroku remote contained an old commit with these plugins. I no longer think this is the case. (I did want to check this, but am unable to get into Heroku console to verify the file structure, because of this error).
To confirm, my vendor/plugins folder is definitely empty on my local master and remote github repo. It should be empty on the remote Heroku branch as I’ve pushed all updates (I even created a completely blank app with a new remote name to test, but got the same error). I say vendor/plugins is empty, but actually vendor/plugins does not exist, having been fully deleted after I removed plugins within.
I did have two plugins installed in the app in an earlier version: HABTM checkboxes and fancybox-rails. These have both been uninstalled rails plugin remove <<plugin name>>.
I’ve checked the file referenced in the error /app/rakefile:7, but can’t see anything wrong with this line MyApp::Application.load_tasks.
If I try to launch heroku console, the error is slightly different and references /app/config/environment.rb:5). I can’t see anything here either MyApp::Application.initialize!
I’ve been through all the likely places looking for any remnants of these plugins or old require statements, and turned up nothing.
I’d really appreciate any ideas as to where else I can look. I can provide more information if needed, I’m simply not sure what’s is useful at this stage!!
Thanks for helping me keep my hair!!
EDIT
I’m adding the full contents of the rakefile that is referred to in the error. I can’t see any issues with this.
# 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
After a lot of hair pulling and frustration, I finally tracked this down to the following entry in the logs
syck.rb parses yaml files, and low and behold I had a (minor) issue with a yaml file omitting some environment specific info.
For more detail, see this SO question.