Ruby-gmail gem setup issues on macOS Snow Leopard

I’m trying to get the ruby-gmail gem working on my Snow Leopard system but running into some problems. The gem installation seems to go fine when I run the install command. Everything looks good during the install process and I get the success message. But when I try to actually use it in a simple test script, things fall apart.

I created a basic test file in my working directory:

require 'rubygems'
require 'gmail'

When I try to run this simple script, I get this error:

/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- mime/message (LoadError)

The error trace points to the gmail gem trying to load mime/message but failing. I checked my gem environment and noticed the error paths don’t match up with the gem paths shown in my environment output. I’m running Ruby 1.8.7 with RubyGems 1.3.7. Not sure if there’s a dependency I’m missing or if this is a path configuration issue. Has anyone else run into this problem?

sounds like the mime-types gem isnt installed properly. try running gem install mime-types first then test ur script again. had similar issue on leopard and that fixed it for me

Had this exact same problem with ruby-gmail on Snow Leopard last year. RubyGems 1.3.7 has notorious issues with handling dependencies compared to newer versions. To resolve it, first run gem uninstall ruby-gmail to clear any broken installations. Then reinstall in this specific order: gem install mime-types, followed by gem install mail, and finally gem install ruby-gmail. One crucial step to note is that Snow Leopard’s Ruby may cache failed dependency loads, so make sure to restart your terminal after installing the gems before testing your script. This approach completely resolved the LoadError for me.

This is a classic dependency issue with older Ruby versions. The ruby-gmail gem needs the mail gem, which requires mime-types, but your system isn’t resolving this chain properly. You should first install mime-types, as mentioned earlier. Then verify if you have the mail gem by running gem list mail. If it’s missing, install it using gem install mail. I’ve experienced this exact problem with Ruby 1.8.7; dependency resolution was often unreliable back then. Once you manually install both dependencies, the gmail gem should function correctly. The path mismatch you’re encountering is a byproduct of missing dependencies, not an actual path configuration issue.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.