You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
はじめに 実際に運用していた時に非同期にしていた主な処理は下記のようなものがあります。 iOS Android の push 通知の送信処理 ログの作成 様々な外部 API の呼び出し 非同期で更新しても問題ないデータの更新 Sidekiq is なに sidekiqは非同期処理を実現する gem 他にも Ruby で非同期処理を実現できる有名な gem には resque や delayed_job 等がある。 sidekiq.org Enterprise版等もありますが、 今回はOSS版を使用している前提でのお話しです。 他の非同期処理が可能な gem との簡単な比較 FAQ · mperham/sidekiq Wiki · GitHub この内容は結構真実を語っていることを最近知った Sidekiq Redis マルチスレッド リトライ処理あり おしゃれなダッシュボード Resque
初めまして、qsona (tw) と申します。Ruby on Rails Advent Calendar 2016 6日目の記事になります。 Rails歴は10ヶ月で、もちろんAdvent Calendarへの参戦も初です。 全体的に生意気な内容と思いますが、 じゃんじゃんマサカリ投げてください お手柔らかにお願いします。 はじめに 環境 JSONを返すAPIで、データベースはRDBを想定してます。 あんまり関係ないですが一応、Rails5 (api mode) + MySQLを想定しています。 マイクロサービスとしてのバックエンドに使う技術スタックの必要な要件 マイクロサービスの良いところは、サービスごとに合った別々の技術が使えるということです。 とはいえ、一般的な組織であれば、学習コストの面などから、ファーストチョイスとなる言語があり、普通の要件に対してはその言語を使う、ということにな
Webpacker has served the Rails community for over five years as a bridge to compiled and bundled JavaScript. This bridge is no longer needed for most people in most situations following the release of Rails 7. We now have three great default answers to JavaScript in 2021+, and thus we will no longer be evolving Webpacker in an official Rails capacity. For applications currently using Webpacker, th
amakan での設計を例に、RailsでSingle-Page Applicationをつくるときの自分のやり方をまとめてみます。 Gem 「JavaScriptで書かれたReactのコンポーネントからHTMLを生成する」というのをRubyでやるために、RubyのV8エンジン実装であるmini_racerというGemを使う。この処理を楽に実行するために、react_on_railsというGemも使う。 gem "mini_racer" gem "react_on_rails" View body要素内のHTMLは全てReactで生成するので、layout以外にviewのテンプレートは存在しない。 Controller 初回リクエストの場合はHTMLを返す ページ遷移時に呼ばれるリクエストの場合はJSONを返す 外部サイトからブラウザバックで戻ってきたときにJSONを見せない という要求に
2017/04/26 curl部分に間違いがあったので修正、ついでにログインの必要な動作を追記 目標 Rails v5.0.0 から追加されたapiオプションを使い、ユーザーの作成と認証機能を実装したベーシックな Rails API を作る rails new まずはプロジェクトを作成します $ rails new devise-api --api --skip-bundle Gemfile に次の gem を追加し, bundle install gem 'devise' gem 'active_model_serializers' devise devise を立ち上げます $ rails generate devise:install create config/initializers/devise.rb create config/locales/devise.en.yml Us
インフラストラクチャー部の成田(@mirakui)です。 Rails の OR マッパーである ActiveRecord ですが、みなさんどのように運用していますか? ActiveRecord を使うと、 SQL を直接扱うことなく、抽象化された表現で RDB にアクセスできるので、アプリケーションの開発効率という観点ではメリットが大きいです。 一方で、 ActiveRecord が駆使されているアプリケーションをサーバに配置してプロダクションとして運用する立場からすると、いくつかの問題に突き当たります。 まずはクックパッド本体アプリケーションにおける、最新の rake stats をご覧ください。 +----------------------+-------+-------+---------+---------+-----+-------+ | Name | Lines | LOC
Find actively maintained & popular open source software libraries for the Ruby programming languageThe Ruby Toolbox is a catalog of all Rubygems that keeps track of popularity and health metrics to help you choose a reliable library CategoriesTo give you an overview of what open source libraries are available for a given task we group projects for common problems into categories. The catalog itsel
2024年4月1日より、Supership株式会社は親会社であるSupershipホールディングス株式会社に吸収合併されました。 合併に伴い、存続会社であるSupershipホールディングスは社名をSupershipに変更し、新たな経営体制を発足しました。本件に関する詳細は、プレスリリースをご確認ください。 2024年4月1日より、Supership株式会社は親会社であるSupershipホールディングス株式会社に吸収合併されました。 合併に伴い、存続会社であるSupershipホールディングスは社名をSupershipに変更し、新たな経営体制を発足しました。 本件に関する詳細は、プレスリリースをご確認ください。
rails gで不要なファイルが生成される・・・ Railsで開発する際に、rails gコマンドは欠かせないと思います。 しかし、特にscaffoldやcontrollerの生成時には不要なファイルが生成される場合があります。 例えば、apiを提供するアプリケーションにjsやcssのファイルは必要ありません。 application.rbのconfig.generatorsでrails gで生成されるファイルを設定できます! 例えば、 apiだからjsとかcssとかいらないな view_helperもいらないな viewのテンプレートエンジンもひとまずなしで viewとview_helperのテストはなくていい fixtureはfactory_girlがいいな。 であれば、こんな感じで設定します config.generators do |g| g.stylesheets false g
思いのほか前回のRailsプチ・デザインパターンの紹介に反応があったので、こういう小ネタも出していったほうがいいのかな、ということで第二弾。 ソーシャル系アプリだと、ユーザとユーザを関連付ける多対多のモデルがたくさんでてきます。たとえば、一般的なところではフォローとかブロックとか足あととか。さらにデーティングサイトになると、ウィンクだったり、Secret admirer(こっそりlikeするけど両思いだったらおめでとうって通知がくるってやつ)だったり、いろいろなモデルがこのパターンにあてはまります。 この場合、「AがBをフォローしている」「BがAをフォローしている」「AとBがお互いにフォローしている」という3つの状態があるわけですが、相互フォローの状態は「AがBをフォローし、かつBがAをフォローしている」と読み替えてSQLでも記述可能なので、以下ではシンプルに単方向のグラフで全てを扱うもの
前置き RailsではRESTfulなインターフェースが基本です。 RESTfulの設計思想では、以下のように処理によってhttpのメソッドの使い分けをすることとされています。 データを参照したいときは、GET データを新規登録したいときは、POST データを更新したいときは、PUT データを削除したいときは、DELETE しかし、現状では、ブラウザはPUT、DELETEメソッドを実装していません。 つまり、現在のWeb環境では、純粋なRESTfulインターフェースを使うことはできないのです。 仕方ないので、Railsでは、 PUT/DELETEをしたいときは、httpのメソッド的にはPOSTを使いながらも、 これはPUTです、これはDELETEです、というフラグを合わせることで、 RESTfulっぽいインターフェースを実現しています。 これが擬似REST方式です。 このあたりはRails
ネットでRails x AngularJSで調べると、AssetsにAngularJSを追加してやるのが普通的なことをよく見る。でも、この方法だとYeomanや、Grunt.jsが使えず、Rails x AngularJSでKarmaでテストを書いたりといったことができないし、AngularJSの作法にのっとった開発ができないのがとてもモヤモヤしていた。 てことで、もうこれはAsset Pipelineを使わない方向で行くのがベストなんじゃないのか、という方向で色々探し回っていたら、同じようなことを考えていた方がいたようで,これを参考にしてもっとベーシックな枠組みを作ってみた。 Asset Pipeline の機能が使えなくなる?ご心配なく。Grunt.jsがJSコードの圧縮、SCSS, CoffeeScriptのコンパイル、さらにLiveloadの恩恵, 画像の圧縮、テストの自動実行もで
2018-05-05追記: Rails 5.0.7で試したけど、この内容で特に問題ないっぽいです。 タネマキの常連さんの松本さんにCarrierWaveてのを教えてもらいました。最近のファイルアップロードはこれがイケてるらしい。 使い方は僕の方で調べたものなんで、もしかしたらおかしいかもしれない。 概要 何それ これこれ。 carrierwaveuploader/carrierwave めんどい そんなあなたのためにシェルスクリプトをご用意致しました。 https://gist.github.com/ginpei/6270837 sedまじ便利。 環境 ruby 2.0.0p247 Rails 4.0.0 準備 アプリ作成
Chefについては前々から気にはなっていたけどまとまった情報があまりなく、中々じっくりと取り組めていなかったのですが、ちょうど次のプロジェクトから導入しようとしていたところに、『入門Chef Solo - Infrastructure as Code』というありがたいまとめ本が出版されたので、それを片手に色々と実験してみました。 入門Chef Soloはよくまとめられていて非常に助かったのですが、Kindleで見ると目次がなくて逆引き的に利用しながら構築するのが結構大変でしたので、自分用に手順書としてまとめてみました。(目次に関しては現在修正版が出ているようです) とりあえずRailsのサービス開発プロジェクトで使いたいので、以前にさくらVPSの設定で行ったような感じでrvm, nginx, unicorn, mysqlでRailsアプリが動くところまでやってみました。もう1年以上前ですが
実践 Rails ―強力なWebアプリケーションをすばやく構築するテクニック 作者: Brad Ediger,株式会社クイープ出版社/メーカー: オライリージャパン発売日: 2008/10/27メディア: 大型本購入: 7人 クリック: 90回この商品を含むブログ (43件) を見る Index はじめに RailsのInstall Railsの基礎 Rubyの基礎文法 はじめに Ruby on Rails入門 (全46回) - プログラミングならドットインストール PythonistaからRubyistへの鞍替えを試みている@yutakikucです。DotInstall等を通してRuby on Railsの基礎を学び中なので学習した内容をまとめていきます。Yahoo!勤務時代はWebFWを自作していた経験もありFWについてはある程度知識を持っている僕から見てもRailsはとても便利ものだ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く