Website loading

Developing mobile apps with Ruby - myth or reality?

Blogpost-featured-image
publisher-image
Victor
Head of Web Development
Apr 29, 2024 • 6 min

Whenever I get a question regarding the perfect tech stack for app development and, especially, “What programming language or framework should I use to build this app?” my response is always, “Whatever you are more comfortable with.” 

I have strong feelings regarding choosing a tech stack, and it’s not usually a specific recommendation, but rather considering that any developer can probably build right about anything with almost all mature languages & frameworks. 

Ruby language is no different, and the many developers who continuously contribute to the community will always make sure they build tools around their needs as long as they can still use their favorite language. 

That’s why, today, we’ll look into how Ruby developers can build mobile applications.

RubyMotion 

One of the first and most popular approaches to mobile development using Ruby code was RubyMotion. It started in 2012, and its first goal was to allow developers to build iOS apps using their preferred open source programming language. It then evolved into supporting Android apps & OS X applications as well. 

The initial need was to replace Objective-C and Java, which were pretty lengthy, and bring Ruby's elegance & productivity-focused features closer to people who wanted to build iOS or Android MVPs. 

The framework began as a commercial project, but in 2020, it switched to an open-source structure that allowed other community members to keep the platform updated with the mobile platform's updates. Unfortunately, the activity was relatively quiet, and it never entirely took off like other hybrid platforms managed to.


The general concept behind RubyMotion was proposing an interface directly with the underlying Objective-C or Java APIs of the iOS and Android platforms that could be accessed using Ruby. That meant that RubyMotion wasn't just a wrapper; it compiled Ruby code into the respective languages, giving developers full access to the device capabilities, UI components, and anything you had access to through the platform's interfaces, as long as the RubyMotion developers kept the project up to date and kept adding the features into their project as well.

This approach also meant that the code was compiled into bytecode, directly interacting with the native APIs, which meant it could also ensure great performance. Comparatively, React Native & Flutter (two of the most popular hybrid mobile development frameworks now that also use a single language and framework for both iOS & Android) use a custom-developed bridge to manage the interaction between the logic (written in Javascript or Flutter) and the UI components. React Native's bridge also takes advantage of the actual native UI components, such as RubyMotion. Still, Flutter took another route and took advantage of widgets, which only mimic the look and feel of native components.

Although a fresh approach with big performance and UI feel potential, RubyMotion didn't quite take off, and its popularity didn't really rise much, especially compared to other non-native mobile development frameworks that are popular now. As far as I saw, the project was still maintained in late 2023, and some articles came out about it as well.

Turbo Native for mobile app development

Turbo Native is part of the Hotwire suite, a set of tools that all Ruby developers know very well and most use very often. The suite was developed by Basecamp, and especially in the web development space, Turbo is used quite often, aiming to bring different features to Ruby and Rails with minimal or no use of Javascript. The cool part of Turbo is that although it started with the web platform in mind, it was designed from the start to integrate perfectly with native hybrid applications for iOS and Android (source Hotwire).

The library evolved from Turbolinks, which initially aimed to partially reload specific components, making websites feel much faster. The next step was building mobile components, and not only having the ability to build an Android and an iOS app with only one codebase but going one step further: building an Android app, an iOS app, and a web app with just one codebase. The main concept behind it is loading the web component into native mobile views, essentially using the Native as a shell/wrapper for webviews.

Turbo Native primarily uses Ruby, HTML, CSS, and JavaScript for both UI and logic, rendered within web views controlled by a minimal native shell. This means the UI is not truly native but rather a web approximation, which can affect performance and user experience compared to fully native apps. However, this approach allows developers to leverage their existing web development skills. While web technologies provide a much larger community and suite of tools to build complex UIs, this approach limits interactivity. 

In scenarios where advanced interactions are necessary, Turbo Native developers might need to write some native code and bridge it to their web-based application. This could involve handling specific gestures in Swift or Kotlin and then communicating those back to the web views running the Turbo-driven interface.

Conclusion

While there are these options to build iOS and Android apps using Ruby, they may not be perfect. We usually recommend building native mobile applications or using a popular hybrid framework, which can offer more attention from maintainers and faster updates. However, the mobile space is continuously evolving, and developers and frameworks need to keep up with it. In light of Ruby on Rails' latest philosophy of being a one-person framework, supporting startups and developers to bring their ideas to life without a large team while using their preferred language, Turbo Native emerges as a viable solution. It may not be the perfect fit for every scenario, but it can successfully meet the needs for a proof of concept, providing reassurance to developers with limited resources.

Do you want to build your next web app using Ruby on Rails or a mobile application, be it a native app or a hybrid app? We're more than happy to talk more about your idea, and help transform it into a real project!

About Wolfpack Digital 🐺

We are an award-winning web and mobile app development company, from Eastern Europe, with over 140 projects successfully delivered to our partners. Everyday, we are guided by our mission to bring performance and beauty to the world through technology. 
We develop apps start-to-end and have extensive expertise in beauty app design and development, fintech app development, healthcare IT solutions, custom website development, cross-platform app development services, and many more.
 

mobile apps with ruby
building mobile apps
rails framework
mobile app automation using ruby
ruby android test
ruby ios test

tech insights & news

blog

Stay up to date with the tech solutions we build for startups, scale-ups and companies around the world. Read tech trends and news about what we do besides building apps.