Redmine on Heroku: missing plugins - ruby-on-rails

My plugins are working fine and appear locally, but as I push my app on Heroku, the plugins index page is empty and there is no plugin...
I've removed everything from my .gitignore to be sure, as suggested here and I've also ran heroku run rake redmine:plugins:migrate.
I've got the following depreciation warnings but I don't know if it comes from here:
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/Rakefile:7)
Plugins in vendor/plugins (/app/vendor/plugins) are no longer allowed. Please, put your Redmine plugins in the `plugins` directory at the root of your Redmine directory (/app/plugins).
However, my plugins are already included in the 'plugins' directory and I'm now kind of stuck on how to solve this problem...
Rails v3.2.17 with Redmine v2.5.1.
Thanks!

In the meantime, I found that it might be related to git submodules problem, as the redmine_app_timesheets folder was present but figured to be empty while running 'heroku run bash'.
So I deleted the two folders and reinstalled the plugin using:
git submodule add https://github.com/maxrossello/redmine_app__space.git plugins/redmine_app__space
git submodule add https://github.com/maxrossello/redmine_app_timesheets.git plugins/redmine_app_timesheets
Plugins are now working, just not sure what configuration I might have lost deleting the local plugins.

Related

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?
I don't have this version of Rails installed to test this with, but I can offer a suggestion in lieu of a definitive answer.
Simply rename the /vendor folder something else and try to run the application again. See if it fails (or some other negative consequences), or succeeds (isn't needed). Even if it succeeds, you can always keep it in case it is needed in the future.
use
mv old-folder-name new-folder-name
so...
mv /vendor /vendor.backup
And everything under it will remain in /vendor.backup
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
No it wont hurt to remove this directory. But it should be enough just to remove /vendor/plugins so no actually need to remove the whole /vendor path.
Rails 4.0 apps have only /vendor/assets/javascripts and /vendor/assets/stylesheets, empty except for the .keep file.
Given it's empty, you could certainly remove /vendor/plugins (which should get rid of the deprecation warning). I would just leave the /vendor/assets directories.
vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/ext/libsass.so: cannot open shared object file: No such file or directory
when i have some troubles in deployment on the server, like compilation of extension ".so". i delete the vendor/bundle of my local app or add it in gitignore. so the built, compilation and deployment is entirely done by the machine running the server.
Your local machine and the machine running the server are always differents.

How to purge Heroku-injected gems

During deployment Heroku injects some plugins
-----> Rails plugin injection
Injecting rails_log_stdout
Injecting rails3_serve_static_assets
..which are becoming deprecated
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/*
I have been using heroku some time ago (and the gems have been injected), but moved to a VPS solution, so I'm not using Heroku anymore. How do I purge the injected plugins from my app? In the end I want to get rid of these deprecation warnings.
The gems are injected at Runtime – if you're using Heroku, you can't avoid them, unless you make a custom buildpack.
If you're not using Heroku anymore, then how/where are you seeing this message?

Rails deprecation warning for vendor/plugins when I don't have any [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
eliminating Rails 2.3-style plugins and deprecation warnings
I get the following error when I do a heroku run console:
$ heroku run console
Running `console` 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 an d 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)
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 an d 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)
Connecting to database specified by DATABASE_URL
Loading production environment (Rails 3.2.8)
irb(main):001:0>
However, the only file I have in vendor/plugins is .gitkeep:
$ ls -lha vendor/plugins/
total 0
drwxr-xr-x 1 Scott Administ 0 Sep 7 12:26 .
drwxr-xr-x 1 Scott Administ 0 Sep 7 12:26 ..
-rw-r--r-- 1 Scott Administ 0 Sep 7 12:26 .gitkeep
I even tried removing the .gitkeep file and I still get the same deprecation warning. Do I have bad plugins? This is a relatively new Rails project.
Heroku injects old-style plugins to make your app work on their server (specifically to redirect logs to stdout, and to serve static assets from rails). Check the output from a git push... you'll see something like this
-----> Rails plugin injection
Injecting rails_log_stdout
Injecting rails3_serve_static_assets
So it's not something you've done, and nor is it anything to worry about! These will work just fine on Rails 3.x and Heroku will no doubt work something out when Rails 4 is a bit more mature.

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
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.
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.
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

removing rails plugins from project

I'm getting this deprecation error on my rails 3.2 project which I upgraded from a rails 3.1 project:
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)
I'm trying to get rid of this error, but I can't seem to find the plugin. I have already deleted the plugin from vendor/plugins.
If your vendor/plugins is completely empty, then I bet you're deploying to Heroku. As part of the deploy process, Heroku injects plugins into your application. Check out this Stackoverflow answer for an actual Heroku response to this issue.

Resources