assets - 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 restart
and重启了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'
我能做什么?
解决方案
解决方案
ln -s /var/cache/redmine/default/plugin_assets
在公共目录中,删除空的 plugin_assets 文件夹后。
这终于对我有用。/var/cache/redmine/default/plugin_assets
所有的资产都在里面。
推荐阅读
- ios - 如何在 UIKit UiSlider 中为自定义 thumbImage 添加阴影?
- c++ - Visual Studio C++ - 模板类 LNK2019 错误
- php - Pico CMS - 标签插件设置和分页
- r - 如何将一个字符串分成多个变量
- reactjs - 来自 json 的 Reactjs setstate
- c# - Sonarqube - 扩展嵌套的三元运算符
- python - Pandas read_csv -- 无法解析字符串“FALSE”
- sql - 如果使用 SQL 找不到所需的值,如何显示 null
- java - Java - 文件中空间输出中的 JAXB Marshaller XML NBSP
- javascript - 为什么我的状态值在获取 url 时没有更新