Platypus is a very cool program that turns scripts (like Perl, Ruby, or Python) into standalone applications for macOS.
I found very little information on how to install Ruby gem dependencies within a Platypus app, so hopefully this post will help.
To install a gem dependency in Platypus, follow these steps:
1. Download the .gem from RubyGems.org.
2. Make a gems/ folder. Put the .gem inside.
3. Using a command-line terminal, cd to just above the gems/ folder.
4. Install the gem locally. This should create a bunch of folders within gems/. At the terminal enter:
require 'rubygems' Gem.use_paths(nil, Gem.path << 'gems/')
This will tell Platypus to look in the gems/ folder for the libraries you need.
Hope this helps!
Thanx for letting me know this. I had been pondering it.
Thanks so much for posting this! I never would have figured this out…sooo helpful!
This:
gem install –local gems/(gem_name)
Should actually be this:
gem install –-local gems/(gem_name)
Ah, thank you thank you! The text in the editing box for the post had double hyphens; it was auto-changed. I put “pre” HTML tages around it to mark it as code and fix it.
Thanks again!