LoginSignup
0
0

More than 1 year has passed since last update.

RansackでRuby2.6未満も対応する

Posted at

RubyonRailsの検索用のGem・Ransackですが、Ruby2.5以下の環境だと普通にGemfileにインストールすると

Gem::RuntimeRequirementNotMetError: ransack requires Ruby version >= 2.6. The current ruby version
is 2.5.0.
An error occurred while installing ransack (2.4.2), and Bundler cannot continue.
Make sure that `gem install ransack -v '2.4.2'` succeeds before bundling.

In Gemfile:
  ransack

となってしまうかと思います(2021年6月時点)。

これに対応するためGemfileに以下のように変更します。

Gemfile
# Ransack
gem "ransack"
Gemfile
# Ransack(For ruby2.3 - 2.5)
gem 'ransack', '2.4.1'

$ bundle update ransack

とします。これでRansackに関連する箇所だけ更新されます。
Thanks to: https://stackoverflow.com/questions/67917260/ransack-with-ruby-2-5/67917783#67917783

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0