mkelley33
mkelley33

Reputation: 5611

How to get mailcatcher to work with rbenv, bundler, and ruby 3.2.0?

I've completely removed rvm and installed 0.5.10 of mailcatcher. When I run mailcatcher I get the following error:

.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-3.2.22.5/lib/active_support/core_ext/object/duplicable.rb:111:in `<class:BigDecimal>': undefined method `new' for BigDecimal:Class (NoMethodError)
    BigDecimal.new('4.56').dup

What could be causing the error?

Upvotes: 0

Views: 496

Answers (2)

neonpalm23
neonpalm23

Reputation: 1

If you don't want it in your gemfile then what worked for me after upgrading to Ruby 3 and rails 7 was to use the latest beta version with gem install mailcatcher --pre.

Upvotes: 0

spickermann
spickermann

Reputation: 107142

Mailcatcher version 0.5.10 was released in September 2012, more than 10 years ago. And this ancient version requires activesupport ~> 3.0 which is part of Ruby on Rails and therefore adding it to your Gemfile and running Bundler, downgraded your application's Rails version to the latest 3.2 version.

To fix this problem, I suggest adding Mailcatcher to your Gemfile without specifying any version, like this

gem 'mailcatcher'

and running bundle install again.

That should install the latest version of the Mailcatcher gem (0.8.2 at the time of writing this answer) which should run fine with up-to-date versions of Ruby on Rails.

Upvotes: 4

Related Questions