首页 > 解决方案 > redmine plugin_assets 仍然为空

问题描述

Ubuntu 18.04/Redmine 3.4.4/nginx

我安装了一些插件,它们本身似乎可以正常工作,但浏览 redmine 时出现大量 404 错误,例如:

GET http://192.168.3.12/plugin_assets/time_logger/stylesheets/time_logger.css net::ERR_ABORTED 404(未找到)

文件夹为空

ls -hail public/plugin_assets/
total 8.0K
923673 drwxrwxr-x 2 www-data www-data 4.0K Aug 30 08:46 .
923173 drwxr-xr-x 8 www-data www-data 4.0K Aug 30 08:46 ..
923674 -rwxrwxr-x 1 www-data www-data    0 Jan  8  2018 empty

迁移插件会给出警告但没有错误:

bundle exec rake redmine:plugins:migrate RAILS_ENV=production
/usr/lib/ruby/vendor_ruby/sprockets/digest_utils.rb:47: warning: constant ::Fixnum is deprecated
/usr/lib/ruby/vendor_ruby/sprockets/digest_utils.rb:51: warning: constant ::Bignum is deprecated
/usr/lib/ruby/vendor_ruby/sprockets/processor_utils.rb:110: warning: constant ::Fixnum is deprecated
/usr/lib/ruby/vendor_ruby/sprockets/processor_utils.rb:111: warning: constant ::Bignum is deprecated
/usr/lib/ruby/vendor_ruby/builder/xchar.rb:111: warning: constant ::Fixnum is deprecated
Migrating periodictask (Redmine Periodictask plugin)...
Migrating redmine_custom_css (Redmine Custom CSS plugin)...
Migrating redmine_local_avatars (Redmine Local Avatars plugin)...
Migrating redmine_mentions (Redmine Mentions)...
Migrating redmine_messenger (Redmine Messenger)...
Migrating redmine_my_page (My Page Customization)...
Migrating redmine_theme_changer (Redmine Theme Changer plugin)...
Migrating time_logger (Time Logger)...




rake redmine:plugins:assets
/usr/lib/ruby/vendor_ruby/sprockets/digest_utils.rb:47: warning: constant ::Fixnum is deprecated
/usr/lib/ruby/vendor_ruby/sprockets/digest_utils.rb:51: warning: constant ::Bignum is deprecated
/usr/lib/ruby/vendor_ruby/sprockets/processor_utils.rb:110: warning: constant ::Fixnum is deprecated
/usr/lib/ruby/vendor_ruby/sprockets/processor_utils.rb:111: warning: constant ::Bignum is deprecated
/usr/lib/ruby/vendor_ruby/builder/xchar.rb:111: warning: constant ::Fixnum is deprecated

我确实用nginx restartand重启了passenger-config restart-app。据我了解,资产应该在重新启动时复制到 plugin_assets 中,但不会发生类似情况。

生产日志:

Started GET "/plugin_assets/time_logger/javascripts/time_logger.js" for 192.168.3.132 at 2019-09-02 08:20:49 +0000

ActionController::RoutingError (No route matches [GET] "/plugin_assets/time_logger/javascripts/time_logger.js"):
  /usr/lib/ruby/vendor_ruby/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  /usr/lib/ruby/vendor_ruby/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  /usr/lib/ruby/vendor_ruby/rails/rack/logger.rb:38:in `call_app'
  /usr/lib/ruby/vendor_ruby/rails/rack/logger.rb:20:in `block in call'
  /usr/lib/ruby/vendor_ruby/active_support/tagged_logging.rb:68:in `block in tagged'
  /usr/lib/ruby/vendor_ruby/active_support/tagged_logging.rb:26:in `tagged'
  /usr/lib/ruby/vendor_ruby/active_support/tagged_logging.rb:68:in `tagged'
  /usr/lib/ruby/vendor_ruby/rails/rack/logger.rb:20:in `call'
  /usr/lib/ruby/vendor_ruby/request_store/middleware.rb:9:in `call'
  /usr/lib/ruby/vendor_ruby/action_dispatch/middleware/request_id.rb:21:in `call'
  /usr/lib/ruby/vendor_ruby/rack/methodoverride.rb:22:in `call'
  /usr/lib/ruby/vendor_ruby/rack/runtime.rb:18:in `call'
  /usr/lib/ruby/vendor_ruby/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  /usr/lib/ruby/vendor_ruby/action_dispatch/middleware/static.rb:120:in `call'
  /usr/lib/ruby/vendor_ruby/rack/content_length.rb:15:in `call'
  /usr/lib/ruby/vendor_ruby/rack/sendfile.rb:113:in `call'
  /usr/lib/ruby/vendor_ruby/rails/engine.rb:518:in `call'
  /usr/lib/ruby/vendor_ruby/rails/application.rb:165:in `call'
  /usr/lib/ruby/vendor_ruby/rails/railtie.rb:194:in `public_send'
  /usr/lib/ruby/vendor_ruby/rails/railtie.rb:194:in `method_missing'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97:in `process_request'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:149:in `accept_and_process_next_request'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:415:in `block (3 levels) in start_threads'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'

我能做什么?

标签: assetsredmineredmine-plugins

解决方案


解决方案

我在这里找到了一个信息

ln -s /var/cache/redmine/default/plugin_assets在公共目录中,删除空的 plugin_assets 文件夹后。

这终于对我有用。/var/cache/redmine/default/plugin_assets所有的资产都在里面。


推荐阅读