解决CommunityEngine在windows下部署时候样式丢失的问题

深度学习(Deep Learning, DL)简介 深度学习(Deep Learning, DL)是机器学习的一个子领域,主要使用多层神经网络来处理复杂的数据和任务。深度学习通过模拟人脑的神经网络结构,能够自动提取特征并进行高效的模式识别和预测。 阅读详情

CommunityEngine 是Rails下一个相当不错的社会化网络插件。

在linux下测试使用时候,相当的顺利,但在Windows下使用时,且在启动的时候出现以下错误,虽然可以正常启动,却发现样式全没了。

  1. Attempting to copy plugin assets from 'E:/workspace/beeblio/vendor/plugins/community_engine/assets' to 'E:/workspace/beeblio/public/plugin_assets'
  2. WARNING: Couldn't create the public file structure for plugin 'community_engine'; Error follows:
  3. Invalid argument - E:/workspace/beeblio/public/plugin_assets/community_engine/E:
  4. Attempting to copy plugin assets from 'E:/workspace/beeblio/vendor/plugins/community_engine/engine_plugins/tiny_mce/public' to 'E:/workspace/beeblio/public/plugin_assets'
  5. WARNING: Couldn't create the public file structure for plugin 'tiny_mce'; Error follows:
  6. Invalid argument - E:/workspace/beeblio/public/plugin_assets/tiny_mce/E:
  7. checking plugin 'engines' for 'application_helper'
  8. checking plugin 'community_engine' for 'application_helper'

折腾半天,后来,发现,其实这根本不是CE的问题,而是CE用到的另一个插件Engine的bug

解决办法是:

打开Vendor/plugins/engines/lib/engines.rb

把第148行         #FileUtils.mkdir_p(base_target_dir) 调整为 FileUtils.mkdir_p(destination)

再次启动CE,发现,样式全回来了,SO cool。

  1. require 'active_support'
  2. require File.join(File.dirname(__FILE__), 'engines/plugin')
  3. require File.join(File.dirname(__FILE__), 'engines/plugin/list')
  4. require File.join(File.dirname(__FILE__), 'engines/plugin/loader')
  5. require File.join(File.dirname(__FILE__), 'engines/plugin/locator')
  6. require File.join(File.dirname(__FILE__), 'engines/assets')
  7. require File.join(File.dirname(__FILE__), 'engines/rails_extensions/rails')
  8. # == Parameters
  9. #
  10. # The Engines module has a number of public configuration parameters:
  11. #
  12. # [+public_directory+]  The directory into which plugin assets should be
  13. #                       mirrored. Defaults to <tt>RAILS_ROOT/public/plugin_assets</tt>.
  14. # [+schema_info_table+] The table to use when storing plugin migration 
  15. #                       version information. Defaults to +plugin_schema_info+.
  16. #
  17. # Additionally, there are a few flags which control the behaviour of
  18. # some of the features the engines plugin adds to Rails:
  19. #
  20. # [+disable_application_view_loading+] A boolean flag determining whether
  21. #                                      or not views should be loaded from 
  22. #                                      the main <tt>app/views</tt> directory.
  23. #                                      Defaults to false; probably only 
  24. #                                      useful when testing your plugin.
  25. # [+disable_application_code_loading+] A boolean flag determining whether
  26. #                                      or not to load controllers/helpers 
  27. #                                      from the main +app+ directory,
  28. #                                      if corresponding code exists within 
  29. #                                      a plugin. Defaults to false; again, 
  30. #                                      probably only useful when testing 
  31. #                                      your plugin.
  32. # [+disable_code_mixing+] A boolean flag indicating whether all plugin
  33. #                         copies of a particular controller/helper should 
  34. #                         be loaded and allowed to override each other, 
  35. #                         or if the first matching file should be loaded 
  36. #                         instead. Defaults to false.
  37. #
  38. module Engines
  39.   # The set of all loaded plugins
  40.   mattr_accessor :plugins
  41.   self.plugins = Engines::Plugin::List.new  
  42.   
  43.   # List of extensions to load, can be changed in init.rb before calling Engines.init
  44.   mattr_accessor :rails_extensions
  45.   self.rails_extensions = %w(action_mailer asset_helpers routing migrations dependencies)
  46.   
  47.   # The name of the public directory to mirror public engine assets into.
  48.   # Defaults to <tt>RAILS_ROOT/public/plugin_assets</tt>.
  49.   mattr_accessor :public_directory
  50.   self.public_directory = File.join(RAILS_ROOT, 'public', 'plugin_assets')
  51.   # The table in which to store plugin schema information. Defaults to
  52.   # "plugin_schema_info".
  53.   mattr_accessor :schema_info_table
  54.   self.schema_info_table = "plugin_schema_info"
  55.   #--
  56.   # These attributes control the behaviour of the engines extensions
  57.   #++
  58.   
  59.   # Set this to true if views should *only* be loaded from plugins
  60.   mattr_accessor :disable_application_view_loading
  61.   self.disable_application_view_loading = false
  62.   
  63.   # Set this to true if controller/helper code shouldn't be loaded 
  64.   # from the application
  65.   mattr_accessor :disable_application_code_loading
  66.   self.disable_application_code_loading = false
  67.   
  68.   # Set this ti true if code should not be mixed (i.e. it will be loaded
  69.   # from the first valid path on $LOAD_PATH)
  70.   mattr_accessor :disable_code_mixing
  71.   self.disable_code_mixing = false
  72.   
  73.   # This is used to determine which files are candidates for the "code
  74.   # mixing" feature that the engines plugin provides, where classes from
  75.   # plugins can be loaded, and then code from the application loaded
  76.   # on top of that code to override certain methods.
  77.   mattr_accessor :code_mixing_file_types
  78.   self.code_mixing_file_types = %w(controller helper)
  79.   
  80.   class << self
  81.     def init
  82.       load_extensions
  83.       Engines::Assets.initialize_base_public_directory
  84.     end
  85.     
  86.     def logger
  87.       RAILS_DEFAULT_LOGGER
  88.     end
  89.     
  90.     def load_extensions
  91.       rails_extensions.each { |name| require "engines/rails_extensions/#{name}" }
  92.       # load the testing extensions, if we are in the test environment.
  93.       require "engines/testing" if RAILS_ENV == "test"
  94.     end
  95.     
  96.     def select_existing_paths(paths)
  97.       paths.select { |path| File.directory?(path) }
  98.     end  
  99.   
  100.     # The engines plugin will, by default, mix code from controllers and helpers,
  101.     # allowing application code to override specific methods in the corresponding
  102.     # controller or helper classes and modules. However, if other file types should
  103.     # also be mixed like this, they can be added by calling this method. For example,
  104.     # if you want to include "things" within your plugin and override them from
  105.     # your applications, you should use the following layout:
  106.     #
  107.     #   app/
  108.     #    +-- things/
  109.     #    |       +-- one_thing.rb
  110.     #    |       +-- another_thing.rb
  111.     #   ...
  112.     #   vendor/
  113.     #       +-- plugins/
  114.     #                +-- my_plugin/
  115.     #                           +-- app/
  116.     #                                +-- things/
  117.     #                                        +-- one_thing.rb
  118.     #                                        +-- another_thing.rb
  119.     #
  120.     # The important point here is that your "things" are named <whatever>_thing.rb,
  121.     # and that they are placed within plugin/app/things (the pluralized form of 'thing').
  122.     # 
  123.     # It's important to note that you'll also want to ensure that the "things" are
  124.     # on your load path in your plugin's init.rb:
  125.     #
  126.     #   Rails.plugins[:my_plugin].code_paths << "app/things"
  127.     #
  128.     def mix_code_from(*types)
  129.       self.code_mixing_file_types += types.map { |x| x.to_s.singularize }
  130.     end
  131.     
  132.     # A general purpose method to mirror a directory (+source+) into a destination
  133.     # directory, including all files and subdirectories. Files will not be mirrored
  134.     # if they are identical already (checked via FileUtils#identical?).
  135.     def mirror_files_from(source, destination)
  136.       return unless File.directory?(source)
  137.       
  138.       # TODO: use Rake::FileList#pathmap?    
  139.       source_files = Dir[source + "/**/*"]
  140.       source_dirs = source_files.select { |d| File.directory?(d) }
  141.       source_files -= source_dirs
  142.       
  143.       unless source_files.empty?
  144.         base_target_dir = File.join(destination, File.dirname(source_files.first))
  145.         #FileUtils.mkdir_p(base_target_dir)
  146.         FileUtils.mkdir_p(destination)
  147.       end
  148.       
  149.       source_dirs.each do |dir|
  150.         # strip down these paths so we have simple, relative paths we can
  151.         # add to the destination
  152.         target_dir = File.join(destination, dir.gsub(source, ''))
  153.         begin        
  154.           FileUtils.mkdir_p(target_dir)
  155.         rescue Exception => e
  156.           raise "Could not create directory #{target_dir}: /n" + e
  157.         end
  158.       end
  159.       
  160.       source_files.each do |file|
  161.         begin
  162.           target = File.join(destination, file.gsub(source, ''))
  163.           unless File.exist?(target) && FileUtils.identical?(file, target)
  164.             FileUtils.cp(file, target)
  165.           end 
  166.         rescue Exception => e
  167.           raise "Could not copy #{file} to #{target}: /n" + e 
  168.         end
  169.       end  
  170.     end   
  171.   end  
  172. end
从零到一:手把手教你用海康VisionMaster完成第一个字符识别项目(附完整流程与避坑点) 本文详细介绍了如何使用海康VisionMaster完成首个字符识别项目,涵盖从环境搭建、图像预处理到系统集成的完整流程。特别分享了Blob分析配置、字符识别优化等实战技巧,帮助开发者避开常见陷阱,快速掌握VisionMaster的基本操作,提升工业自动化场景下的字符识别效率。 阅读详情

相关推荐

蓝牙HCI Dongle实战:从芯片选型到协议栈集成的完整指南

本文详细介绍了蓝牙HCI Dongle的实战应用,从芯片选型到协议栈集成的完整指南。通过对比CSR8510、nRF52840等主流芯片的性能和价格,提供选型建议和避坑技巧。同时,深入解析Zephyr协议栈移植和常见问题排查,帮助开发者高效完成蓝牙项目开发。

weixin_30786657的博客 322

在安装oracle中遇到问题汇总

在安装oracle中遇到的问题 1、配置磁盘分区时,/root最大只能50G,/home 860G,想把/Home的磁盘空间设置为50G,其他移到/根目录下 出现这个原因是,第一次默认安装的时候centos提供的建议分区方案,下次重新安装centos时,会默认以上次分区方案为准,需要进入自主创建分区,删除系统提供的分区方案,然后创建/root(挂载到/根目录)和swap分区,/...

weixin_30502965的博客 652

【mip-NeRF】使用一组二维图像渲染3D场景视频(mip-NeRF论文复现)

本文对mip-NeRF模型的pytorch实现进行了复现

Ryan2k的博客 1841

解决Fedora 下 RMagic无法安装的问题

初次安装时,出现以下错误[root@www Tim]# gem install rmagick Building native extensions.  This could take a while...ERROR:  Error installing rmagick:    ERROR: Failed to build gem native extension./usr/bin/ruby 

iLinux 2147

MATLAB/Simulink BLDC电机控制模型搭建:六步换相与速度环实战

无刷直流电机(BLDC)控制是电机驱动领域的核心技术,其六步换相原理通过霍尔信号控制逆变器开关,使定子磁场与转子磁场保持垂直以产生最大转矩。在MATLAB/Simulink中搭建BLDC控制系统,需从电机本体建模入手,结合PWM占空比调节和速度环PI控制器,实现速度闭环与波形观测。该技术广泛应用于电动工具、无人机电调和伺服驱动器等场景。本文详细解析BLDC六步换相逻辑、反电动势建模及Simulink分层设计方法,帮助读者掌握从零搭建完整控制模型的工程实践。

weixin_28273593的博客 207

GD32F103入门实践(一)配置环境,搭建工程模板,烧写程序

写在前面 本系列博客是我初学GD32F103的操作实录,我个人是个小白,在学习过程中真的也遇到了不少坑,因此我希望能记录下来,帮助到同样踩坑的你。 我的芯片是GD32F103ZE,软件是Keil,烧写用的是JLink。 材料准备 首先我在兆易创新官网(兆易创新),下载相关的文件。点击资料下载,在搜索框里输入“GD32F10”可以得到相关的资料,其他芯片类似。比较重要的是GD32F10x AddOn和GD32F10x Firmware Library(固件库),这两个必须下载。 下载Keil MDK5,这

qq_41208487的博客 3万+

linux下配置Mongrel cluster服务的自启动

1.先确定安装了mongrel及mongre cluster在shell命令行中输入gem search mongrel -l若看到mongrel和mongre cluster则表示已安装若没有则用以下命令安装[root@www~]#gem install –include-dependencies mongrel [root@www~]#gem install –includ

iLinux 2134

Oracle 常用语法汇总

CREATE TABLE 表名(COMMENT ON COLUMN 注释;-- 创建一个学生表STUDENT_ID NUMBER(10) PRIMARY KEY, -- 学生ID,主键FIRST_NAME VARCHAR2(50) NOT NULL, -- 学生名字,不允许为空LAST_NAME VARCHAR2(50) NOT NULL, -- 学生姓氏,不允许为空EMAIL VARCHAR2(100) UNIQUE, -- 学生电子邮箱,唯一。

拽着尾巴的鱼儿的博客 2156

Date Time Format in ruby

%a - The abbreviated weekday name (``Sun)%A - The full weekday name (``Sunday)  %b - The abbreviated month name (``Jan)  %B - The  full  month  name (``January)  %c - The preferred local date

iLinux 1714

Jetson Orin Nano - SONY imx415 camera驱动开发

基于英伟达 Jetson orin nano 平台 imx415 camera驱动开发

hinewcc的博客 3241

嵌入式工程师成长之路(3)——PCB设计

带有目的的学:要知道,PCB板子做出来需要我们给厂家哪些东西,我们设计板子的时候,需要遵循哪些设计规范,防止画好也是块废板子。然后再逐步开始学习画板。

云轩阁 8万+

Ruby String Replacement, Substitution and Insertion

Changing a Section of a StringRuby allows part of a string to be modified through the use of the []= method. To use this method, simply pass through the string of characters to be replaced to the

iLinux 1692

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

Apache Software Foundation Distribution Directory

收藏一个网址Apache Software Foundation Distribution Directory 包含阿帕奇软件基金会所有发行的软件(历史到当前).前段时间,想下载apache软件基金会的ANT1.65版本,可发现ANT项目的主页一直都访问不了.昨天无意之中发现了这个网址,MARK一下

iLinux 1661

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Mongre cluster服务的安装与配置

STEP1.安装必备的gem包gem install –include-dependencies mongrelgem install –include-dependencies mongrel_clusterSTEP2.配置Mongre_cluster的设置比较简单,进入Rails应用的根目录,执行cd /var/www/demomongrel_rails

iLinux 1236

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

【数据结构-5】单链表的实现

单链表,具体来说是单向的、不带头的、不循环的链表。链表由一个一个节点组成,每个节点分为数据域和指针域,数据域存放数据,指针域存放下一节点的地址。这样,就可以根据指针域中的地址找到下一个节点,节点就串起来了构成了单链表。

weixin_44218929的博客 162

C# 数据结构和特殊类型

.NET Core(现称.NET)提供丰富数据结构,优化性能与开发效率。日常开发首选List<T>和Dictionary<TKey,TValue>;高性能场景推荐Span<T>与Memory<T>减少内存分配;并发环境使用ConcurrentDictionary等线程安全集合;避免非泛型集合如ArrayList。

cccloveforever的博客 664

工厂设备接MES为什么慢:协议识别与点表配置自动化的技术拆解

工业现场设备接 MES 的周期主要消耗在协议识别与点表配置。本文拆解这条链路的四层结构,给出点表映射的数据模型、两种部署架构的对比,以及可直接落地的三项验收口径与校验代码。适合工控集成、MES 实施、设备联网方向的工程师。

emfuture的博客 370

list

的底层是双向链表结构,双向链表中每个元素存储在互不相关的独立节点中,在节点中通过指针指向其前一个元素和后一个元素。,因此反向迭代器的实现可以借助正向迭代器,即:反向迭代器内部可以包含一个正向迭代器,对正向迭代器的接口进行包装即可。是可以在常数范围内在任意位置进行插入和删除的序列式容器,并且该容器可以前后双向迭代。迭代到该位置,在这段位置上迭代需要线性的时间开销;最大的缺陷是不支持任意位置的随机访问,比如:要访问。还需要一些额外的空间,以保存每个节点的相关联信息。个元素,必须从已知的位置。

xie0510_的博客 268

向 excel、word、pdf 三种文档中占位符插入数据

【代码】向 excel、word、pdf 三种文档中占位符插入数据。

weixin_45934659的博客 48

C++ STL 反向迭代器:从源码框架到适配器实现

在 C++ STL 中,反向迭代器(reverse_iterator)是一个很典型的设计案例:它本身并不直接持有容器数据,而是通过封装一个正向迭代器,把「前进」变成「后退」,从而让同一个容器既能正序遍历,也能逆序遍历。本文从 SGI-STL 3.0 的源码框架出发,梳理反向迭代器的设计思路,再手写一个通用的迭代器适配器,并在vector和list中完成适配与测试。在 SGI-STL 3.0 中,反向迭代器的核心源码位于。反向迭代器是一个适配器,各个容器再基于它适配出自己的反向迭代器类型。下面截取list。

Godbro的博客 229

软件商店常见问题标准处理流程

从底层软件源来看,/etc/apt/sources.list配置错误、源地址失效、公网与内网离线源混用、ARM64与x86_64架构源串用,以及DNS解析异常、系统代理配置错误,都会导致商店无法获取应用数据;打开该应用,确认可正常运行;软件商店作为系统内置的图形化软件分发与安装入口(UKUI桌面配套组件,底层依赖APT软件源),承担着应用软件的浏览、搜索、下载、安装、升级与卸载等核心功能,是终端软件部署与管理的关键通道。覆盖软件商店启动、页面加载、应用下载、安装、卸载、搜索、自身更新等全部业务场景。

qq_39496637的博客 259

【AI 开发从入门到进阶 · 10】收官篇:LoRA 微调、模型评估、推理加速与生产部署全链路

本文系统梳理了大模型微调与生产落地的全流程,从决策是否微调、优选LoRA技术方案,到代码实现、效果评估、推理加速与FastAPI服务封装,最终构建可迭代的生产级AI系统。强调“逐级升级”原则,倡导以数据闭环驱动优化,避免技术冲动。全系列贯穿工程化思维,提供可复用模板与实战建议,助力开发者从模型训练迈向稳定可用的AI服务部署。

信息安全领域优质创作者|操作系统领域专家 14

LangGraph 的分离思想总结

LangGraph 的分离思想,本质上是对"高内聚、低耦合"这一经典工程原则在 LLM 应用领域的落地。它通过状态与逻辑分离、节点职责分离、控制流与执行分离、计算与持久化分离、编排与实现分离五个层面,把一个难以维护的"大黑盒"拆解成一组可组合、可测试、可观测的部件。理解这套分离思想,比记住 API 更重要——因为当你面对新的智能体场景时,真正指导你做出合理拆分的,正是这些分离原则。

张晨光老师的播客 366
上一篇: Fedora 9 下使用apache+mongrel+rails轻松架设ROR应用
下一篇: Mongre cluster服务的安装与配置
forlinux
博客等级 码龄21年 53粉丝 95原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值