mailcatcher: `method_missing': undefined method `this' for # (NoMethodError)

I have installed both mailcatcher versions 0.6.3 and 0.6.1.

When I run the command mailcatcher, I get the following error:

/Users/jquigl44/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:2159:in `method_missing': undefined method `this' for #<Gem::Specification:0x3fc0e842c3fc activesupport-4.2.5.1> (NoMethodError)
    from /Users/jquigl44/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1057:in `find_active_stub_by_path'
    from /Users/jquigl44/.rvm/rubies/ruby-
. . .
    from /Users/jquigl44/.rvm/gems/ruby-2.2.2@avant_basic/bin/ruby_executable_hooks:15:in `<main>'

Please help.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 35 (10 by maintainers)

Most upvoted comments

This worked for me. $ gem uninstall mailcatcher (from your local gemset)

As per the instructions on mailcatcher.me, run the following two lines: $ rvm default@mailcatcher --create do gem install mailcatcher $ rvm wrapper default@mailcatcher --no-prefix mailcatcher catchmail

$ mailcatcher Starting MailCatcher ==> smtp://127.0.0.1:1025 ==> http://127.0.0.1:1080 *** MailCatcher runs as a daemon by default. Go to the web interface to quit.

I was able to fix this error by upgrading rubygems to the latest version

gem update --system

It’s a bug in rubygems, may be below listed help you.

  1. Open file rubygems/specification.rb /Users/amitagarwal/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb
  2. add method def this; self; end in the end of file
  3. rvm reload
  4. restart your application

I ran in to this error when trying to run use the travis gem. Running gem pristine --all fixed it for me.

It doesn’t.

It seems to happen in a particular edge case with rubygems, rvm and bundler. MailCatcher being an independent gem often used within projects with similar dependencies using bundler seems to hit the edge case more often.