The Ruby Native setup guide
Add Ruby Native, connect your coding agent, and run one prompt. Your agent makes your Rails app look and feel native, then you scan a code and see it running on your phone.
$ bundle add ruby_native
This registers Ruby Native with Claude Code in .mcp.json. Using a different agent? It also prints the snippet to paste into that agent's MCP settings. Restart your agent so it picks it up.
$ bundle exec ruby_native mcp install
Your agent runs the Ruby Native generator, updates your views to make it look like a real app, checks its work, and installs cloudflared for the preview.
Welcome back. What should we work on?
No slash commands in your agent? Paste the output of bundle exec ruby_native ship instead.
It creates config/ruby_native.yml with a starter tab bar and colors, and allows the preview tunnel host in development.
$ bin/rails generate ruby_native:install
Each one starts with what it looks like on your phone when it's missing. Most of the work is hiding web-only elements and letting Ruby Native render them natively.
Hide your web navbar and footer from native users with the native-hidden class.
<header class="native-hidden">
<footer class="native-hidden">
Opt into safe areas with the viewport meta tag, the Ruby Native stylesheet, and the native-inset class on your content wrapper.
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<%= stylesheet_link_tag :ruby_native %>
<main class="native-inset"><%= yield %></main>
Define your tabs in YAML and let Ruby Native draw a native tab bar instead. Icons use SF Symbols (iOS) or Material Symbols (Android) names.
tabs:
- title: "Home"
path: "/"
icon: "house"
- title: "Profile"
path: "/profile"
icon: "person"
Add native_form_tag to every page with a form on it, so going back from the success page skips the form.
<%= native_form_tag %>
Make the session cookie permanent so native users stay signed in between launches. Then render native_identity_tag on every page so signing out clears every tab.
cookies.signed.permanent[:session_id] = session.id
<%= native_identity_tag(current_user&.id) %>
Set background_color in your config to the exact value of your CSS body background.
appearance:
background_color: "#0f172a"
Turn on Advanced Mode for native push and pop transitions and a native navigation bar. It needs Turbo Drive on every page, so check for data-turbo="false" first, and switch native-inset to native-inset-top.
app:
mode: advanced
The preview opens a tunnel with cloudflared. If it's missing, the preview offers to install it with Homebrew.
$ brew install cloudflare/cloudflare/cloudflared
With your Rails server running, start the preview. It opens a tunnel to your app and prints a QR code.
Long-press the Ruby Native app icon on your phone, tap Switch website, and scan the QR code from your terminal. Your Rails app is now running on your phone.
$ bundle exec ruby_native preview
Tunnel connected. Scan this QR code:
https://your-tunnel.trycloudflare.com
Create your Ruby Native account and your agent walks your app through the App Store and Google Play. No wrangling with Xcode, signing certificates, or provisioning profiles.
Or continue in your agent.
Email me at [email protected] and I'll help you get your app up and running.