並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 19 件 / 19件

新着順 人気順

Gemfileの検索結果1 - 19 件 / 19件

  • Gemfileのベストプラクティス

    長年の運用で「Gemfileはこう運用すると上手くいった」という知見が蓄積されてきたので、ここに書き出してみておく。 Bundler/OrderedGemsを有効化する RuboCopの Bundler/OrderedGems Copを有効化する。 悪い例: gem 'puma' gem 'jbuilder' 良い例: gem 'jbuilder' gem 'puma' セクションを分けない 基本的に、独自の判断で空行を入れてセクションを分けたりしない。 ここで言うセクションとは「空行で区切られた1つのまとまり」のことである。Bundler/OrderedGems は、このまとまりの中で辞書順であることを要求する。 悪い例: gem 'aws-sdk-rails' gem 'aws-sdk-s3' gem 'graphql' gem 'graphql-batch' 良い例: gem 'aw

    • HEY's Gemfile

      Gemfile ��)HyU �0*HyU ruby '2.7.1' gem 'rails', github: 'rails/rails' gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data # Action Text gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' gem 'okra', github: 'basecamp/okra' # Drivers gem 'mysql2' gem 'sqlite3' # Used for asset generation in BK gem 'redis', '~> 4.0' gem 'redis_connectable', github: 'basecamp/redis_conn

        HEY's Gemfile
      • Ruby: GemfileとGemfile.lock究極ガイド(翻訳)|TechRacho by BPS株式会社

        概要 元サイトの許諾を得て翻訳・公開いたします。 英語記事: The Ultimate Guide to Gemfile and Gemfile.lock | Saeloun Blog 原文公開日: 2022/08/16 原著者: Keshav Biswa サイト: Saeloun Blog Ruby on Railsの開発者なら、GemfileやGemfile.lockを知らない人はいないでしょう。この2つのファイルはRuby gemをインストールするのに欠かせませんが、仕組みを知らないままでは混乱する可能性もあります。本記事では、Gemfileとは何か、その中に何があるのか、および使い方について解説します。 最初に、デフォルトのRails 7アプリケーションを作成し、それからGemfileの各行を調べて意味を理解していきましょう。 新規作成したアプリのディレクトリには、Gemfileと

          Ruby: GemfileとGemfile.lock究極ガイド(翻訳)|TechRacho by BPS株式会社
        • Gemfile of dreams: the libraries we use to build Rails apps—Martian Chronicles, Evil Martians’ team blog

          From time immemorial, the Evil Martians team has worked on dozens of Ruby on Rails projects every year. Naturally, this process involves a lot of Ruby gems. Some reflect our desire to be cutting-edge and to use modern tools (or build our own!) Other gems are so flexible they’ve been used in most of our projects. Our development philosophies, programming habits, and soul are within this universe of

            Gemfile of dreams: the libraries we use to build Rails apps—Martian Chronicles, Evil Martians’ team blog
          • GemfileでのRubyバージョン指定を.ruby-versionから読む - koicの日記

            Gemfile での Ruby バージョンの指定を、値の直書きではなく .ruby-version からの読み込みに変更する設定です。 https://github.com/rubygems/rubygems/pull/6876 例えば、Rails アプリケーションなんかで Gemfile に .ruby-version と同じ 3.3.0 を指定しているようであれば、以下のように記述できます。 -ruby '3.3.0' +ruby file: '.ruby-version' asdf に類するものを使っているようであれば、ruby file: '.tool-versions' と記します。 https://github.com/rubygems/rubygems/pull/6898 この設定によって Ruby のアップデート時のバージョンの更新ポイントを減らすことができます。 なお、古

              GemfileでのRubyバージョン指定を.ruby-versionから読む - koicの日記
            • gemfile.directory

              A directory of Rails Gemfiles for inspiration and learning!

                gemfile.directory
              • RenovateのGemfileやPodfileの更新でリリースノートを取得する - いけだや技術ノート

                Renovateは様々なデータソース・パッケージマネージャーに対応していて、もちろんRubyのBundlerのGemfileにも対応しているのだが、APIリクエストのレートリミットを回避する関係で、https://rubygems.org をデータソースとする場合はリリースノートの取得ができなくなっている。 これが不便で、自分達のチームではGemfileの更新にはDependabotを併用するという面倒な運用をしていた。最近になってこれを部分的に解消できる設定がRenovateに誕生したのでご紹介。 customChangelogUrlという設定を使うと、あるパッケージのリリースノートを探しにいくURLを指定することができる。これを使うとGitHubやGitLabの該当リポジトリのReleasesや CHANGELOG.md などからリリースノートをリストアップしてくれる。 例えばfast

                  RenovateのGemfileやPodfileの更新でリリースノートを取得する - いけだや技術ノート
                • Gemfileに記載してあるgemの説明を一覧で表示する #fjordbootcamp - アジャイルSEの憂鬱

                  追記: bundle info でgemの情報を表示できるので、一覧じゃなければコレで十分かも。 $ bundle info rails * rails (6.1.3.2) Summary: Full-stack web application framework. Homepage: https://rubyonrails.org Documentation: https://api.rubyonrails.org/v6.1.3.2/ Source Code: https://github.com/rails/rails/tree/v6.1.3.2 Changelog: https://github.com/rails/rails/releases/tag/v6.1.3.2 Bug Tracker: https://github.com/rails/rails/issues Mailin

                    Gemfileに記載してあるgemの説明を一覧で表示する #fjordbootcamp - アジャイルSEの憂鬱
                  • Understanding The Gemfile.lock File

                    If you’re not familiar with Gemfiles and gem versioning, this guide will make more sense if you start with my guide on updating gems. The very first time you run bundle install in a Ruby project that has a Gemfile, Bundler will automatically create a file called Gemfile.lock. That is the authoritative source of the gems your project uses, and their versions. Gemfile.lock makes sure that when you s

                      Understanding The Gemfile.lock File
                    • [Ruby] Bundled gemsはGemfileに指定して使おう

                      まとめ Rubyインストール時に同梱されるgemは、Standard gemsと呼ばれるが、これらはDefault gemsとBundled gemsの2種類に分かれる Bundled gemsは、bundlerを利用するプロジェクトでは、Gemfileに指定&bundle installする必要がある トラブル例: 古いRubyのバージョンのプロジェクト中で使っているライブラリが、Rubyの新バージョンでBundled gemになっていて、新しいRubyでbundle exec ruby foo.rbするとin `require': cannot load such file -- minitest/autorun (LoadError)のようにrequireに失敗した Bundled gemsのリストは、gems/bundled_gemやhttps://stdgems.org/で確認で

                        [Ruby] Bundled gemsはGemfileに指定して使おう
                      • Ruby: Gemfileに.ruby-versionを読み込む便利技(翻訳)|TechRacho by BPS株式会社

                        以下の過去記事で、Gemfile内に記述するRubyバージョン指定をゆるくすることを推奨したことがあります。これは現在でも価値のある方法ですが、それとは別にほとんどの場合でうまく動く方法を紹介します。 参考: Use Loose Ruby Versioning in Your Gemfile - Andy Croll この便利なワンライナーを教えてくれたEmmaに感謝します。 chrubyなどのRubyバージョンマネージャは、個別のアプリケーションのrootディレクトリ内に置かれている.ruby-versionファイルを探索することで、アプリケーションで指定のRubyバージョンが必ず使われるようにします。 アプリケーションで必要なRubyバージョンをこの.ruby-versionファイルで指定すると、バージョンマネージャは環境を自動で切り替えて指定のRubyバージョンを使うようにします。

                          Ruby: Gemfileに.ruby-versionを読み込む便利技(翻訳)|TechRacho by BPS株式会社
                        • GemfileのPLATFORMSの書き方 - komagataのブログ

                          bundle2.2からか対応platformが細かくなった。 arm64-darwin-22 arm64-darwin-23 x86_64-darwin-21 x86_64-darwin-22 x86_64-linux こんな感じでosのバージョン毎に追加してくのは辛い。みんなどうやってるのかなと思ってSlackのruby-jpのsupportチャンネルで質問させてもらいました。 gohさん、kojix2さんに教えていただきました。ありがとうございます。 結論から言うとこう言う感じで良さそう。 PLATFORMS universal-darwin x86_64-linux mac関連は全部universal-darwinでOK。CIや本番環境、WSL2の人用にはx86_64-linuxでOK。

                          • eval_gemfile

                            ちょっとしたコード変更を紹介するシリーズ。 - instance_eval( - File.read('Gemfile') - ) + eval_gemfile('Gemfile') Gemfileから別のGemfileを評価したいときに使えるメソッドとして、eval_gemfile (Bundler::Dsl#eval_gemfile) があったことを、他人のコードを読んでいて思い出した。結果的に、上記のように書き換えた。やっていることは大体同じだけど、異常系の考慮や相対パスの取り扱いなど細かなことをやってくれるし、DSLに入りてはDSLに従うべきだろうという考えの元で。 こういうきもい処理は、複数のGemfileを運用するとき場合などに出てくる。例えば、アプリケーションでRails 6と7との過渡期で並行運用するときや、ライブラリで複数のバージョンのGemをテストするときなど。

                            • Gemfile並行運用時のTips

                              複数のGemfileを並行運用する際に便利な情報を幾つか挙げておく。 更新漏れの検知 複数のGemfileを並行運用していると「Gemfile.lockを変更したがもう1つのlockファイルの更新を忘れてしまった」という事態が起き得る。これを避けるために、差分検知を行うworkflowを設けておくと有用である。 以下はr7kamura/gemfile-diffというactionで実現する例: name: gemfile-diff on: pull_request: paths: - Gemfile.lock - Gemfile_rails_8_0.rb.lock jobs: run: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: r7kamura/gemfile-diff@v0 with: gemfile

                              • Dependabot を使ってGitHubのGemfileのアップデートのPRを作る

                                目的 RailsプロジェクトのGemfileを最新に保つべく、Dependabotを使う 手順 /.github/dependabot.yml をdefault branchにcommitするだけです。 documentは下記です。 自分の設定 以下自分が使っている設定です。 version: 2 updates: - package-ecosystem: "bundler" directory: "/" target-branch: "develop" schedule: interval: "weekly" day: "friday" time: "00:32" timezone: "Asia/Tokyo" versioning-strategy: "lockfile-only" open-pull-requests-limit: 2 - package-ecosystem: "npm

                                  Dependabot を使ってGitHubのGemfileのアップデートのPRを作る
                                • Gemfile の Dual Boot 方法 - id:onk のはてなブログ

                                  Gemfile 内で切り替える こういう ENV で切り替えるやつとか、eval_gemfile を使うやつとか。 https://github.com/discourse/discourse/blob/v2.6.2/Gemfile#L9-L16 def rails_master? ENV["RAILS_MASTER"] == '1' end if rails_master? gem 'arel', git: 'https://github.com/rails/arel.git' gem 'rails', git: 'https://github.com/rails/rails.git' else # NOTE: Until rubygems gives us optional dependencies we are stuck with this needing to be explic

                                    Gemfile の Dual Boot 方法 - id:onk のはてなブログ
                                  • Rails 7.0.0+Ruby 3.1.0のGemfileは7-0-stableブランチの指定が必要|TechRacho by BPS株式会社

                                    2022.01.05 Rails 7.0.0+Ruby 3.1.0のGemfileは7-0-stableブランチの指定が必要 現象 Ruby 3.1.0がリリースされた直後にRails 7.0.0をRuby 3.1.0で動かそうとすると、以下のRails::Engine is abstract, you cannot instantiate it directly.エラーが出て動きませんでした。これはrails newの場合ですが、他の操作でも出ました。 $ dip rails new . --skip-git Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_nam

                                      Rails 7.0.0+Ruby 3.1.0のGemfileは7-0-stableブランチの指定が必要|TechRacho by BPS株式会社
                                    • Gemfile の ~> という記号はどういう意味なのか

                                      RubyGems の依存関係を管理してくれる Bundler の Gemfile 内で使われる ~> という記号はどう言う意味なのでしょうか. Bundler のバージョンは 1.16.1 になります. 例えば次のような Gemfile があった場合, source 'https://rubygems.org' gem 'nokogiri' gem 'rack', '~> 2.0.1' gem 'rspec'

                                      • gemspecのadd_development_dependencyではなく、Gemfileを使う? - Qiita

                                        久しぶりに、bundle gem で gem を作ったら、rake や rspec が、gemname.gemspec ではなく、Gemfile に記載されるようになっていたので、調べてみました。 調べた結果、Gemfile のほうが柔軟性があり、実際のユースケースでも gemspec の add_development_dependency だけでは対応できないことがある、そのため Bundler では Gemfile の使用を奨励するために修正した、ということのようです。 なお、この記事は、「こういう理由でこうした方が良い」というものではないです。 経緯 久しぶりに bundle gem コマンドで gem を作りました。

                                          gemspecのadd_development_dependencyではなく、Gemfileを使う? - Qiita
                                        1