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

SIwave学习记录:电热耦合仿真 SIwave电热耦合仿真 阅读详情

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
FANUC机器人S523 新款PN板卡与西门子PLC通信配置介绍 阅读详情

相关推荐

IAR下载Linux环境适配:入门级安装指导

详细介绍如何在Linux系统中完成iar下载与环境配置,帮助开发者快速上手IAR集成开发环境,解决常见安装问题,提升开发效率。

weixin_35754676的博客 772

在安装oracle中遇到问题汇总

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

weixin_30502965的博客 653

整理的15个公开且可直接使用的电力视觉输电线路领域数据集

而巡检数据是目前来说影响我们做科研的最大阻碍,为此本内容主要总结了,现有的且公开免费的巡检数据集,供大家使用。STN PLAD数据集133个航拍图像,五个电力部件:电力塔及其塔的ID、绝缘子,防震锤,联板(yoke),图像的尺寸在5472×3648到5472×3078。IDID数据集:2000张图像,包含三个类别,正常绝缘子,破损绝缘子和闪络绝缘子三个类别,用于目标检测的实验。TTPLA数据集,用于实例分割,1100张尺寸为3840×2160,包含两个类别,电力杆塔和电力线。主要用于电力杆塔的目标检测。

weixin_42048361的博客 5052

解决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 2148

Unity中URP实现水体效果(泡沫)

在上篇文章中,我们实现了水体的深度。在这篇文章中,我们来使用上篇文章采样后的深度图来实现水中的泡沫效果。

楠溪泽岸的博客 3495

神经形态芯片:IBM TrueNorth技术详解以及应用案例

2018年的一项演示中,机器人使用TrueNorth处理了复杂的路径规划,功耗仅为传统系统的1/10。它通过模仿人脑的结构,解决了传统芯片在功耗和并行性上的痛点,并在图像识别、物联网和机器人等领域展现了强大潜力。:不同于传统芯片的时钟驱动,TrueNorth是事件驱动的。例如,工厂中的振动传感器使用TrueNorth检测设备故障的早期迹象,实现了更高效的维护策略,避免了停机时间。:在医疗领域,TrueNorth可以用于可穿戴设备,比如一个智能助听器,它能过滤噪音并增强特定声音,功耗低到可以用纽扣电池供电。

远程部署调试 运行安装 项目调试 二次开发 项目技术新 持续迭代 部分源码免费分享 2496

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 2135

第一节:初识n8n与下一代工作流自动化

本章介绍了n8n的Fair-code理念与节点式架构,对比了其与Zapier/Make的核心差异,并引导读者在n8n Cloud上完成首次界面导览,建立了工作流自动化的宏观认知。

easeyoo的专栏 109

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 1716

Sigrity OptimizePI IC Device Power Pin Inductance Analysis模式如何计算IC电源管脚电感操作指导

Sigrity OptimizePI IC Device Power Pin Inductance Analysis模式可以计算电容到IC电源管脚的电感,用于评估电容位置对于IC电源管脚的效果,如何分析,以下图为例进行说明。Capacitors:选择层面,这里选择top layer(IC在top层),下方可以选择电容的size,这里选择All Size。IC devices,输入U*, A*, B*, Q*, P*,将所有这些字母开头的器件都识别为IC。模式如何计算IC电源管脚电感操作指导。

weixin_54787054的博客 418

YOLO26 无损剪枝:稀疏训练 + 结构化通道裁剪

YOLO26 无损剪枝链路:YOLO26s (7.2M) → 稀疏训练 30 epoch (L1 on BN gamma, lam=0.01) → 阈值剪枝 50% (gamma<quantile(0.5)) → 结构化重建 Conv+BN → 微调 10 epoch (lr=1e-4) → YOLO26n (1.9M, mAP50 0.808, 仅降 0.6%)。核心贡献:稀疏训练让 BN gamma 趋向二元分布 (近 0 或近 1), 剪枝阈值可直接取 median 自动 50% 压缩。

m0_64661770的博客 267

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

FC7300 Clock介绍

FC7300的时钟架构包括一个高级时钟图和内部时钟需求。它有5个CMU,使用SIRC监控FIRC/SOSC/FOSC,并使用FIRC监控SIRC。此外,CMU4还使用FOSC监Slow Clock。

舊梦的博客 331

Apache Software Foundation Distribution Directory

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

iLinux 1663

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

贝叶斯统计 [韦来生编]

贝叶斯(Bayes)统计是近几十年来迅速发展起来的数理统计的一个重要分支。贝叶斯方法与经典统计方法的主要不同之处是进行统计推断时除了利用样本信息外,还要利用参数的先验信息,因此可以提高统计推断或统计决策的效果。它在经济、金融、生物、医学、自然科学和社会科学等许多领域具有广泛的应用。贝叶斯方法的研究已渗透到了统计学的几乎所有领域。作者在给中国科学技术大学概率论与数理统计专业本科生开设的“数理统计”课程中有一章专门讲授“贝叶斯方法和统计决策理论”,近十年来也给中国科学技术大学概率统计专业研究生开设过几次“贝叶斯分析”课。本书是在对过去讲稿的内容作了适当的增减和调整的基础上完成的。  本书共分六章。第1章是绪论,介绍了贝叶斯统计的若干基本概念,同时对必要的数理统计的基础知识有重点地作了回顾。第二章介绍了确定先验分布的若干可供选择的方法。第三章介绍了几类常见统计模型参数的后验分布的主要结果和计算方法。第四章和第五章分别介绍了“贝叶斯统计推断”和“贝叶斯统计决策”的内容。第六章介绍了贝叶斯统计计算的若干方法,包括蒙特卡洛方法和马尔可夫链蒙特卡洛(MCMC)方法以及相关统计软件的简介。本书的每一章附右大量的例题和习题,书末附有常用的几个表格和部分习题解答供读者查用。  大约可在54学时内讲授本书的第1章至第六章的主要内容,教师可根据学时需要选讲本书第1章至第六章的部分内容。书中标“*”号的章节可略去不讲,留给读者作为阅读材料。第六章例题中的R代码和部分例题的数据文件等可从作者个人主页下载。  作者在编写本书的过程中参考了J.O.Berger教授的《统计决策论及贝叶斯分析》和茆诗松教授编写的《贝叶斯统计》等书中的一些内容,以及《贝叶斯分析》一书中由张伟平博士编写的有关贝叶斯统计计算的一些内容。在此表示衷心感谢。  本书编写准备过程中,中国科学技术大学统计与金融系的几个研究生帮助完成了本书部分中文的录入和排版,作者对他们的辛勤工作表示真诚的感谢。高等教育出版社为本书的出版给予了大力支持。在此一并致谢。

Mongre cluster服务的安装与配置

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

iLinux 1240

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

AI 答案漂移检测:嵌入相似度、阈值标定与告警实现

做 GEO 监测的人迟早会遇到一个尴尬:上周还在报告里写「这个问句已经稳定被引用」,这周客户自己一问,答案换了个品牌。问题不在监测方法,而在多数监测系统只存「有没有提到」,不存「答案长什么样」。这篇写我们这套漂移检测模块的实现,目标是回答一个问题:同一个问句,今天的答案和两周前相比,变了多少,这个变化是正常抖动还是异常。

helloworld19920的博客 190

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

Vue开发篇之组件通信与表单:点了任务行,谁来更新列表

用四个Vue组件完成任务录入与状态切换,跟踪props、事件转发和表单草稿的归属。

code2cat的博客 286

import cn.hutool.core.collection.CollUtil常用库介绍一下

在平时的 Java 开发中,只要涉及到集合的判空、去重、求交集/差集、List 转 Map 等操作,都可以优先看看。

qq_26889291的博客 244

Java 面试题:数组和 List 如何快速互转?最佳方案是什么?(其他高频面试API)

业务需求推荐 APIList 判断元素是否存在contains()List 根据条件查询单个对象List 根据条件查询多个对象List 判断是否存在符合条件的数据anyMatch()List 排序后快速查找Map 根据 Key 查询 Valueget()Map 判断 Key 是否存在大量数据判断元素是否存在List 根据 ID 高频查询List 转 HashMap两个 List 根据 ID 关联一个 List 转 Map。

两点 604

C++STL03_list与容器适配器 | 为什么 list 的 insert 不失效

list 和 vector 都能存一串数据,为什么一个 insert 会失效、另一个不会? | v 本文先讲清 list 的底层——双向带头循环链表,再对比它与 vector 的差异 | v 然后看 stack、queue、priority_queue 这三个"容器适配器"怎么基于现成容器改出接口 | v 最后补上模板进阶(非类型参数、特化、分离编译)。

2502_92159017的博客 563

函数式编程

本文介绍Java 8函数式编程核心内容,涵盖Lambda表达式、Stream流、Optional及方法引用。通过对比传统匿名内部类,展示Lambda简化代码的便捷性;以Stream流实现集合链式操作,高效完成过滤、去重、遍历等任务;结合实际案例,说明函数式编程提升开发效率、增强可读性与并发处理能力的优势,助力开发者快速掌握现代Java编程范式。

fzt12138的博客 202

XML读成嵌套Map,这个Java工具类5个方法纯JDK实现

本文分享一款JDK17环境下的Java XML嵌套转换工具类,内置5个开箱即用的方法,基于JDK自带DOM实现零第三方依赖,支持XML转嵌套Map、Map转XML两大核心能力,满足老系统接口对接、报文临时转换、配置导出等场景需求。工具类内置XXE防护,禁止DOCTYPE与外部实体;约定#attrs存属性、#text存混合内容,自动处理同名兄弟标签聚合成List、空元素识别、转义防护等复杂场景;提供XML声明开关、属性/文本键常量,边界处理严格,异常信息明确,读写结果可预判且往返恒等,适合报文对接、配置转换、

Java后端 | AI智能体应用实战派 | 电脑技能行家 275

第 05 篇|慢查询优化实战 —— 一条 SQL 的重构全过程

本文是「数据库性能优化」系列的第 05 篇,把第 04 篇的索引与执行计划原理,落地成一套可复用的慢查询优化流程。全程沿用第 02 篇的订单表作为案例,从慢日志采集、六步分析法,到六个经典慢查询场景的双库改写,再到 sysbench 与 pgbench 的压测量化,最后产出一份可打印的优化 checklist,让系列前后呼应、闭环落地。

Diligently 505

NCCL-AllReduce-用户缓冲区注册及设备Work构造 (六)

在传统 Collective 路径中,主机根据任务选定的算法、协议和连接能力,为符合条件的用户缓冲区准备注册资源。每个任务各有一份设备 Work,其中保存缓冲区地址、归约参数和注册状态。下图以同一 communicator 中的 Ring 任务 A 和 NVLS 任务 B 为例,说明相关对象由谁持有、注册结果保存在哪里,以及任务和 Work 如何交给后续的 Plan 编排。保留任务及注册记录。保存已完成分类和调优的任务,保存按地址范围组织的注册记录。

非专业业余程序员 287
上一篇: 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、付费专栏及课程。

余额充值
⌂ 换网址