ruby_native
Ruby Native turns a Rails app into iOS and Android apps. This gem is the Rails-side integration: view helpers, a YAML config file, endpoints auto-mounted at /native, and a CLI for previewing and deploying builds. Full docs, including the complete helper reference and config schema, live at rubynative.com/docs.
It is built for teams with a Rails product whose customers want an app. You keep one codebase and one roadmap: Ruby Native renders the HTML you already write as native tab bars, navigation, forms, and push notifications, builds the apps in the cloud with no Xcode or Android Studio, and submits them to the App Store and Google Play. A coding agent can drive every step through the bundled MCP server, stopping only for the few clicks Apple keeps for a person. Apps built with it run on 150,000+ devices. Pricing is one plan per app, $199 a month or $1,990 a year, at rubynative.com/pricing; the phone preview costs nothing and needs no account.
Installation
gem "ruby_native"
The engine auto-mounts at /native. No route configuration needed.
Getting started
Run the install generator:
rails generate ruby_native:install
This creates config/ruby_native.yml with tabs taken from your routes. If you use a coding agent, hand it the rest here:
bundle exec ruby_native mcp install
Then say: set up Ruby Native in this app. It wires the layout, checks its own work, and later drafts the listing, captures screenshots, and submits for review, stopping only for the few clicks Apple keeps for a person. By hand, the same steps are:
-
Edit the config with your colors and tabs (see below).
-
Add the stylesheet and viewport-fit=cover to your layout <head>:
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<%= stylesheet_link_tag :ruby_native %>
viewport-fit=cover is required for CSS env(safe-area-inset-*) variables to resolve to real values instead of 0.
-
Add the tab bar to your layout <body>:
<%= native_tabs_tag %>
-
Preview it on your phone (see below).
The full walkthrough, including safe area layout and hiding web-only navigation with native_app?, is at rubynative.com/docs/setup.
Configuration
config/ruby_native.yml controls the native shell:
appearance:
tint_color: "#007AFF"
background_color: "#FFFFFF"
tabs:
- title: Home
path: /
icon: house
- title: Profile
path: /profile
icon: person
Changes are picked up without restarting the server in development. See rubynative.com/docs for the full schema: appearance and dark mode, navbar branding, Advanced Mode, OAuth, and linked domains.
In-app purchase and push routes
In-app purchase routes are off by default. bin/rails g ruby_native:iap turns them on, or add this to config/initializers/ruby_native.rb:
RubyNative.configure { |config| config.iap_enabled = true }
This adds the purchase, completion, restore, and Apple subscription webhook routes.
The push device route, POST /native/push/devices, is on by default. Set config.push_enabled = false to handle it yourself with your own post "/native/push/devices" route, since the app always sends tokens to that path.
Restart the server after changing the initializer.
Preview
Preview your app on a real device without deploying:
bundle exec ruby_native preview
This starts a Cloudflare tunnel and shows a QR code for the Ruby Native app to scan. Your Rails server needs to be running separately. Requires cloudflared:
brew install cloudflare/cloudflare/cloudflared
The tunnel points at port 3000, or at PORT when it is set, the same way rails server picks its port. Pass --port 4000 to override, or --url for an upstream that isn't on localhost.
See rubynative.com/docs/cli for deploy, login, and auto-deploying from CI.
React and Vue
Building with Inertia instead of ERB? @ruby-native/react and @ruby-native/vue provide the same helpers as npm packages, versioned alongside this gem. See rubynative.com/docs/inertia for setup.
AI agents
Every docs page serves markdown: append .md to the URL or request Accept: text/markdown. For an index of everything, fetch rubynative.com/llms.txt, or llms-full.txt for the complete docs as a single file.
MCP server