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
I am upgrading a Rails project to Ruby 3.1.2, from 2.6.6. I initially ran into this problem, but fixed it with adding gem 'psych', '< 4' into the Gemfile. I should note that an answer there mentioned downgrading to Ruby 3.0.3, but that does not fix my issue.
After adding that, the project worked fine regarding Psych. Unfortunately, when trying to commit/push, the overcommit hook returns this error:
/.rbenv/versions/3.1.2/lib/ruby/3.1.0/bundler/runtime.rb:309:in 'check_for_activated_spec!': You have already activated psych 4.0.4, but your Gemfile requires psych 3.3.2. Prepending 'bundle exec' to your command may solve this. (Gem::LoadError)
I also tried changing overcommit's version and got this error: Since "psych" is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports psych as a default gem.
Versions
ruby 3.1.2p20
psych (3.3.2)
overcommit (0.58.0)
The text was updated successfully, but these errors were encountered:
Fixes#789
`psych` is no longer a default gem, but current and old ruby still ships
with it. When we `require 'yaml'`, we activate that gem in whatever
version that is bundled with ruby. Later on, we load bundler, and we
`Bundler.setup`, which will then activate whatever version specified in
the lock file. More often than not, they might not match.
The approach in this PR is to strip the `yaml` dependency completely
from the hook scripts, while retaining the ability to configure the
Gemfile using it.
I am upgrading a Rails project to Ruby 3.1.2, from 2.6.6. I initially ran into this problem, but fixed it with adding
gem 'psych', '< 4'
into the Gemfile. I should note that an answer there mentioned downgrading to Ruby 3.0.3, but that does not fix my issue.After adding that, the project worked fine regarding Psych. Unfortunately, when trying to commit/push, the overcommit hook returns this error:
/.rbenv/versions/3.1.2/lib/ruby/3.1.0/bundler/runtime.rb:309:in 'check_for_activated_spec!': You have already activated psych 4.0.4, but your Gemfile requires psych 3.3.2. Prepending 'bundle exec' to your command may solve this. (Gem::LoadError)
I also tried changing overcommit's version and got this error:
Since "psych" is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports psych as a default gem.
Versions
The text was updated successfully, but these errors were encountered: