Denkinovelという、ノベルゲーム風の小説を書ける投稿サイトをRails + Herokuで開発しています。 サービスの特性上assetsに多くの画像、音楽ファイルを置いているので、HerokuのSlug size 200MB縛りがきつくなってきました。こんな状況のためにasset_syncというgemがあるので、使ってみることにしました。Heroku公式で推奨しているgemです。 herokuでのasset_syncの使い方は、英語公式がこちら。https://devcenter.heroku.com/articles/cdn-asset-host-rails31 ボランティアによる日本語訳もあります。ありがたい。こちらです。https://github.com/herokaijp/devcenter/wiki/cdn-asset-host-rails31 インストール herok
Rubyの高機能なREPLであるpryとマルチクラウド対応ライブラリのfogを利用して、簡単に複数のクラウドを扱うことができます。 TL;DR pryとfogを組み合わせるとクラウドの操作に補完・シンタックスハイライト・履歴・Rubyの配列操作などが使え非常に便利 fogが提供しているインターフェースにより異なるサービスでも同じコマンドで操作できる 仮想マシンだけでなくオブジェクトストレージ、DNS、CDNも扱える 準備 pryとfogをインストールしておきます。 ライブラリのインストール Pry::Commands.create_command "fog" do description "Connect to the service provider using Fog" command_options :keep_retval => true banner <<-BANNER Usag
Read below for tips. If you still need help, you can: Ask your question in The Sidekiq Google Group Open a GitHub issue. (Don't be afraid to open an issue, even if it's not a Sidekiq bug. An issue is just a conversation, not an accusation!) You should not email any Sidekiq committer privately. Please respect our time and efforts by sticking to one of the two above. Remember also that Sidekiq is fr
Heroku とかの Paas を利用していると発生するファイルのアップロード問題を解決するため、AWS S3 を利用し、ファイルの保存、配信を行う。 ファイルのアップロードについては gem CarrierWave を利用する。 CarrierWave の利用については以下を。 Rails gem CarrierWave を利用してファイルをアップロードする CarrierWave で、ファイルの保存先を AWS S3 に指定するため fog という gem を利用する。 fog は AWS S3 に限らず、様々なクラウドのサービスを Ruby から利用しやすくするためのライブラリ。 fog : The Ruby cloud services library GitHub リポジトリ : fog 前提 バージョン
Fog で S3 の期限付き URL を取得したい場合は、Fog::Storage::AWS::File#url を使用すればよい。有効期限となる時刻は引数で指定する。 require 'active_support/core_ext' require 'fog' fog_storage = Fog::Storage.new(aws_settings) bucket = fog_storage.directories.get(bucket_name) file = bucket.get(path) expire_time = 30.second.since file.url(expire_time) Register as a new user and use Qiita more conveniently You get articles that match your needsYou
Did you know that you can navigate the posts by swiping left and right? Awesome! 31 Dec 2012 . category: . Comments All successful projects grow. In the beginning we usually don’t care about scalability so much. The need of it comes often suddenly. You cannot predict effects of being advertised on popular blog or going viral. Then you need to scale up to serve the traffic. There are many options t
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 but can work on an
asset_sync gem error :( The first error I started out with was related to the unf gem, so I added gem "unf", "~> 0.1.3" to my gemfile and tried things again. No luck :( After more research I may have an issue with another setting related to my aws bucket. My dns is hosted via route53 and I wanted to use a custom domain to serve my assets. This means my bucket will look like assets.domain.com inste
ども、マイケル(日本人)です。 調子がいいのでブログ連投してみます。 carrierwaveでめっちゃはまったのでその話を書きます。 carrierwave便利なんですがちょっといじるとすぐはまりますね。。。 やりたいこと carrierwaveのキャッシュファイルはlocalに、実画像はS3に置く(その際画像はjpgに変換) nginxで動的にサムネイル生成してcloudFrontでキャッシュさせたものをアプリ側で読み込む ちなみにnginx等のインフラ周りの設定については書きません。 なぜならインフラ構築したのは僕じゃないから(`・ω・´) うちのスーパーインフラエンジニア様が3秒でやってくれました、もしかしたらブログに書いてくれるかもしれません。 画像UPLOAD実装 んでは早速実装していきましょう。 まずはドキュメントみてS3に上げる設定をしてください。 あと画像のリ
rubyで画像アップロード機能を作成するには様々なgemがありますが、carrierwaveが一番お手軽でわかりやすいので一番使っています。 carrierwaveではストレージを自由に選択できるので、ストレージをfogにすればS3との連携も簡単にできます。 以下の例は管理しているrailsアプリケーションのストレージをfogにする設定です。 CarrierWave.configure do |config| config.cache_dir = "#{Rails.root}/tmp/uploads" config.fog_credentials = { :provider => 'AWS', :aws_access_key_id => 'YOUR ACCESS KEY', :aws_secret_access_key => 'YOUR SECRET', :region => 'ap-no
Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news. fog is a Ruby gem by Wesley Beary to control a variety of cloud services through a unified API. It deals with both server cloud and storage based services and supports Amazon S3 and Rackspace Files; as well as servers and on Amazon EC2, Rackspace Servers, Terremark vCloud and Slicehost. Support is also available for Amazon
最近、私は仕事でChefを使いました。Chefの中のKnifeと呼ばれるコマンドラインツールでは、幾つかのクラウドサービスに対応しています。 Launch Cloud Instances with Knife - Chef - Opscode Open Source Wiki それはRubyのライブラリ「fog」を利用することで実現していました。 そこで第1回目の今回から数回に分けて、このfogについて調べたことを書いてみようと思います。 参考になるサイト まずはfogの公式サイトとRubyGems.orgです。 fog - The Ruby cloud services library fog | RubyGems.org | your community gem host また最近、Engine Yardのブログにおいて、fogの作者であるgeemus (Wesley Beary)さん
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く