DEV Community

Joseph Schito
Joseph Schito

Posted on β€’ Edited on

2 1 3 1 1

Create a MacOS desktop application with pure Ruby (Tutorial)

This is (for now) a modest step-by-step tutorial about creating a MacOS desktop application with Ruby.
I used Traveling Ruby and Platypus, so it doesn't need any system dependencies to run because it downloads Ruby executables and installs gems in the application bundle.
(I'll try to make it more detailed and add more features in the future).

Tested on Apple M3

1

You have your Ruby application inside a example folder
Image description

2

Create a ruby2pack.rb file outside example
Image description
and fill it with this gist https://gist.github.com/josephschito/96c0e385cb803f3778fb4c40226e64f5

3

From IRB require that file with require ./ruby2pack and run Ruby2Pack.new(source_path: 'example', ruby_version: '3.3.0', platform: 'osx-arm64', rel: '20240215').run.
Test your application execution by running ./dist/osx-arm64-3.3.0-20240215/run

4

Download Platypus from https://github.com/sveinbjornt/Platypus/releases
and run it

5

Image description

Follow the image instructions and then press [Create App]

THE END

That's it! πŸŽ‰

Image description

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup πŸš€

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

Top comments (4)

Collapse
 
andyobtiva profile image
Andy Maleh β€’ β€’ Edited

I was able to follow these instructions successfully to package a Glimmer DSL for LibUI desktop application as a native MacOS Sonoma 14.4.1 desktop application on my M2 Chip MacBook Pro.

Thank you for sharing.

Collapse
 
chipcastle profile image
CHIP CASTLE β€’

Do you have a sample I can review? I was able to get the first 2 tutorials working from Traveling Ruby, but haven't gotten anything working with a Glimmer DSL project. I've modified the ruby2pack.rb somewhat and think I'm getting close. Any suggestions are appreciated. Thanks Andy!

Collapse
 
kclement profile image
K Clement β€’

@andyobtiva Could you please share your steps? I followed the above instruction but it didn't work. I built with the glimmer "scaffold[app_name]" cmd and seems like main.rb file doesn't exist.

Collapse
 
blag profile image
Alvaro (Blag) Tejada Galindo β€’

Awesome! I need to try this soon! 🀩

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

πŸ‘‹ Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay