Categories
Ruby On Rails

Old rails project with gem install errors :/

One does not simply “gem install thin -v 1.5.1” on new Macs, when the project depends on ruby 2.5.7..

At work I am going to work on an older rails project… Like many other Rails projects, this one can only run on older versions of ruby. Hence I install rbenv and tried my luck.

My luck failed though and I had some issues installing “thin” gem which is used with “mailcatcher” gem.

Eventually I found this post, which helped my Mac compile the thin gem file with native extensions:

https://meta.discourse.org/t/mailcatcher-gem-installation-issue-on-macos-catalina-and-its-solution/168606

Long story short:
install the gem separately with custom compiler flags and run bundler install again.

rbenv exec gem install thin -v 1.5.1 -- --with-cflags="-Wno-error=implicit-function-declaration"

At last i can run rbenv exec bundler install and the rest of the installation can being.

Leave a Reply

Your email address will not be published.