登录 注册
其他
1,892
Stars
334
Forks
30
Watchers
62
Open Issues
待补全
许可证
Ruby
语言
2011-07-30
创建时间
2026-10-31
最近更新

项目能做什么

用于在 Rails 与 S3 之间同步静态资源的工具。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
[![Gem Version](https://img.shields.io/gem/v/asset_sync.svg?style=flat-square)](http://badge.fury.io/rb/asset_sync)
[![GitHub Build Status](https://img.shields.io/github/actions/workflow/status/AssetSync/asset_sync/tests.yaml?branch=master&style=flat-square)](https://github.com/AssetSync/asset_sync/actions/workflows/tests.yaml)
[![Coverage Status](http://img.shields.io/coveralls/AssetSync/asset_sync.svg?style=flat-square)](https://coveralls.io/r/AssetSync/asset_sync)


# Asset Sync

Synchronises Assets between Rails and S3.

Asset Sync is built to run with the new Rails Asset Pipeline feature introduced in **Rails 3.1**.  After you run __bundle exec rake assets:precompile__ your assets will be synchronised to your S3
bucket, optionally deleting unused files and only uploading the files it needs to.

This was initially built and is intended to work on [Heroku](http://heroku.com) but can work on any platform.

## Upgrading?

Upgraded from 1.x? Read `UPGRADING.md`

## Installation

Since 2.x, Asset Sync depends on gem `fog-core` instead of `fog`.  
This is due to `fog` is including many unused storage provider gems as its dependencies.  

Asset Sync has no idea about what provider will be used,  
so you are responsible for bundling the right gem for the provider to be used.  

In your Gemfile:
```ruby
gem "asset_sync"
gem "fog-aws"
```

Or, to use Azure Blob storage, configure as this.

``` ruby
gem "asset_sync"
gem "gitlab-fog-azure-rm"

# This gem seems unmaintianed
# gem "fog-azure-rm"
```

To use Backblaze B2, insert these.

``` ruby
gem "asset_sync"
gem "fog-backblaze"
```


### Extended Installation (Faster sync with turbosprockets)

It's possible to improve **asset:precompile** time if you are using Rails 3.2.x
the main source of which being compilation of **non-digest** assets.

[turbo-sprockets-rails3](https://github.com/ndbroadbent/turbo-sprockets-rails3)
solves this by only compiling **digest** assets. Thus cutting compile time in half.

> NOTE: It will be **deprecated in Rails 4** as sprockets-rails has been extracted
out of Rails and will only compile **digest** assets by default.

## Configuration

### Rails

Configure __config/environments/production.rb__ to use Amazon
S3 as the asset host and ensure precompiling is enabled.


``` ruby
  #config/environments/production.rb
  config.action_controller.asset_host = "//#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com"
```

Or, to use Google Storage Cloud, configure as this.

``` ruby
  #config/environments/production.rb
  config.action_controller.asset_host = "//#{ENV['FOG_DIRECTORY']}.storage.googleapis.com"
```

Or, to use Azure Blob storage, configure as this.

``` ruby
  #config/environments/production.rb
  config.action_controller.asset_host = "//#{ENV['AZURE_STORAGE_ACCOUNT_NAME']}.blob.core.windows.net/#{ENV['FOG_DIRECTORY']}"
```

Or, to use Backblaze B2, configure as this.

``` ruby
  #config/environments/production.rb
  config.action_controller.asset_host = "//f000.backblazeb2.com/file/
阅读完整原文

项目深度分析 AI 生成

Rails 资产跨云分发与构建加速 CLI / 服务

产品构想针对现代 Rails 6/7/8(结合 Propshaft/Sprockets/Tailwind)构建跨云、增量极快且自动管理多版本回滚和智能失效的云原生分发工具/SaaS。
核心功能本地/CI 多线程并行哈希比对并上传、针对 Brotli/Gzip 自动预压缩上传、一键 Cloudflare/CloudFront 智能失效推送、版本回滚安全防护。
目标用户使用现代 Rails 且追求 CI/CD 极速构建的中小开发团队、外包技术团队。
难度/周期中等 · 2-3 个月 · 成本:极低(主要是云测试存储与 CI 环境搭建成本)
收费模式开源核心 CLI + 商业版(增值功能:构建提速代理、团队配置看板、商用技术支持订阅)。
竞争风险现代 Rails (Propshaft) 和标准 CI(如 GitHub Actions 配合 AWS CLI)已经能较好解决资产同步,需求壁垒较低。
依据 已验证事实(README提及增量上传和多存储支持)与尚需验证的假设(市场对现代Rails专用分发服务的付费意愿)

云存储资产冗余分析与清理(Cost Optimizer)SaaS

产品构想静态分析 Rails 应用生成的大量历史 Digest 资产,智能识别不再引用的旧版本文件并执行安全删除,降低 S3/GCS 存储与请求费用。
核心功能通过分析 manifest.json 审计孤儿静态文件、保留最近N个版本回滚安全期、一键模拟与自动化清理策略、成本优化节约报告。
目标用户资产库运行多年、S3账单居高不下的中大型 Rails 项目团队及运维人员。
难度/周期低到中等 · 1-2 个月 · 成本:低(云开发环境、测试账号费用)
收费模式按扫描存储容量收费,或按每月帮助节省的存储账单抽成(Gain-share),或提供单次审计买断服务。
竞争风险误删可能导致旧客户端加载白屏;现代存储成本较低,节省的绝对金额可能不足以驱动购买。
依据 AI推测

遗留 Rails 项目资产迁移与现代化改造咨询服务

产品构想为运行在旧版 Rails(如 Rails 3/4/5,正如 README 所述的历史版本)上的企业,提供 Asset Pipeline 升级改造、从 fog 依赖剥离或迁移至现代构建工具(Vite/Propshaft)的服务。
核心功能Sprockets 资产流转审计、打包链路迁移方案、CI 部署流水线加速、多云高可用分发架构落地方案。
目标用户缺乏重构人力的传统 SaaS 企业、拥有高历史技术债务的成熟 Rails 企业。
难度/周期低 · 按项目交付(1-2 周/项目) · 成本:无额外成本(主要为人力时间)
收费模式按项目收取专家服务费或按工时计费(T&M 模式)。
竞争风险纯定制咨询服务难以规模化复制,获客依赖个人品牌与特定社区渠道。
依据 数据支持的判断(项目针对 Rails 3.1 诞生,技术代际明显)
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

相似项目数据正在完善中,暂不展示(避免误导)

项目优势与风险

技术成熟度创建于 2011-07-30,近 30 天仍在推送
社区活跃Star 1,892 / Fork 334 / Issue 62(数据支持,可自行核实)
许可证未检测到(需人工确认)
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。