通过NODE_ENV可以来设置环境变量(默认值为development).一般我们通过检查这个值来分别对开发环境和生产环境下做不同的处理.可以在命令行中通过下面的方式设置这个值: linux & mac: export NODE_ENV=production windows: set NODE_ENV=production 比方说如果代码中要对生产环境下做一些处理,可以这样写: if (process.env.NODE_ENV === 'production') { // just for pr
在windows环境下运行compass文件出现的错误提示解决方案 例如:经常在项目中运行grunt命令编译scss文件的时候,会出现下面的错误提示 (Encoding::CompatibilityError on line ["87"] of c: incompatible character encodings: GBK and UTF-8) 解决方法:1.项目中可能包含了中文路径,把中文路径改为英文路径 2.在scss文件中可能用了中文注释,把
将ROR项目从development环境改为production环境时,运行rake assets:precompile后, ckeditor的界面就无法完整显示?! @_@?? 出现 ActionController::RoutingError (No route matches [GET] "/assets/ckeditor/config.js") solution :creating a rake task that couples with "assets:preco
最近配置production环境,找了好几份文档,从傻逼到苦逼~~终于配置成功~~@_@!!! 首先,先加载以下几个插件: # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # Use CoffeeScript for .js.coffee assets and views gem 'coffee-rails', '~> 4.0.0'# Use jquery as the JavaScri
Video.js是一个非常强大的视频播放库,能在微信下完美提供inline小窗口播放模式,但当涉及到hls格式视频播放时就比较麻烦,出现的数种现象都不好解决. 错误现象: 1. PC Chrome上提示格式不支持,此问题主要是Chrome本身不支持HLS格式导致的. VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The media could not be loaded, either because the server or n
错误信息 Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` 因为rails 4 出于安全考虑,需要在production 的情况下 ,生成一个key,通过 web_app/config/secrets.yml 读取. production: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 由