Search code examples
ruby-on-railsherokuruby-on-rails-plugins

Could I delete /vendor folder from Rails application?


I am using Ruby 1.9.3p194 with Rails 3.2.13 and have newly created an Rails application which contains /vendor folder with .gitkeep files:

/vendor/assets/javascripts
/vendor/assets/stylesheets
/vendor/plugins

all the folders are empty.

When I run this application on Heroku it warns:

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/1/4/rails-3-2-0-rc2-has-been-released.
(called from <top (required)> at /app/config/environment.rb:5)

Could this /vendor folder be deleted completely without any negative consequences?


Solution

  • You get this message on Heroku because with Rails 3 they inject plugins at compile time for logging and pipeline.

    To prevent these deprecation notices if you add

    gem 'rails_12factor', group: 'production' 
    

    to your gemfile they will disappear since this gem provides the same functionality as the previously injected plugins. This recently came up on the Heroku Changelog - see https://devcenter.heroku.com/changelog-items/318