Andy Harvey
Andy Harvey

Reputation: 12653

Deploy to heroku generating plugin deprecation warning, but no plugins exist

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

Upvotes: 1

Views: 2345

Answers (3)

Andy Harvey
Andy Harvey

Reputation: 12653

After a lot of hair pulling and frustration, I finally tracked this down to the following entry in the logs

/usr/local/lib/ruby/1.9.1/syck.rb:135:in `load': syntax error on line 7, col 11: `' (ArgumentError)

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.

Upvotes: 2

Ryan Daigle
Ryan Daigle

Reputation: 11667

The plugin deprecation warnings are from plugins Heroku injectes into your application at build time so it runs appropriately on the platform. Those can be ignored.

The crux of the issue appears to be related to a syntax error in your source/rake file. Here's the important output:

rake aborted!
syntax error on line 7, col 11: `'

Look at line 7 of the file the error originates from (post the rest of the stack trace for our reference?) and you'll find some sort of syntax error that needs to be fixed.

If you want to clearly separate the plugin loading and app load-time you use heroku run bash to load a shell and then run the rake task to see its output isolated:

$ heroku run bash
> bundle exec rake db:migrate

Hope that helps.

Upvotes: 1

sailor
sailor

Reputation: 8034

I read somewhere that heroku uses plugins to automate some tasks... so it's not your fault

If you want to silence the deprecation warnings, use this little snippet:

# Load the rails application
require File.expand_path('../application', __FILE__)

# Initialize the rails application
ActiveSupport::Deprecation.silence do
  Selfcare::Application.initialize!
end

Upvotes: 0

Related Questions