The Ruby Native setup guide

Get your Rails app on your phone.

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.

1

Add Ruby Native to your app

Terminal

$ bundle add ruby_native

2

Connect your coding agent

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.

Terminal

$ bundle exec ruby_native mcp install

3

Run the setup prompt

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.

Your coding agent

Welcome back. What should we work on?

/mcp__ruby-native__ship

No slash commands in your agent? Paste the output of bundle exec ruby_native ship instead.

Rather set up Ruby Native by hand? The same steps your agent takes, one at a time.

Run the install generator

It creates config/ruby_native.yml with a starter tab bar and colors, and allows the preview tunnel host in development.

Terminal

$ bin/rails generate ruby_native:install

Make the seven changes

Before. Content covered by the status bar with web-based header and tabs.
Library screen, before
After. Native tab bar, native navigation, and safe areas handled.
Library screen, after

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.

  • Two headers stacked on top of each other.

    Hide your web navbar and footer from native users with the native-hidden class.

    app/views/layouts/application.html.erb

    <header class="native-hidden">

    <footer class="native-hidden">

  • Content tucked under the status bar or home indicator.

    Opt into safe areas with the viewport meta tag, the Ruby Native stylesheet, and the native-inset class on your content wrapper.

    app/views/layouts/application.html.erb

    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">

    <%= stylesheet_link_tag :ruby_native %>

    <main class="native-inset"><%= yield %></main>

  • A web hamburger or bottom navigation that feels out of place.

    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.

    config/ruby_native.yml

    tabs:

    - title: "Home"

    path: "/"

    icon: "house"

    - title: "Profile"

    path: "/profile"

    icon: "person"

  • Going back from a saved form lands on the form again.

    Add native_form_tag to every page with a form on it, so going back from the success page skips the form.

    app/views/posts/new.html.erb

    <%= native_form_tag %>

  • Signed out at random, or somebody else's screens after signing out.

    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.

    app/controllers/concerns/authentication.rb, app/views/layouts/application.html.erb

    cookies.signed.permanent[:session_id] = session.id

    <%= native_identity_tag(current_user&.id) %>

  • A white flash between screens.

    Set background_color in your config to the exact value of your CSS body background.

    config/ruby_native.yml

    appearance:

    background_color: "#0f172a"

  • Pages slide in like a website, not an app.

    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.

    config/ruby_native.yml

    app:

    mode: advanced

Install cloudflared

The preview opens a tunnel with cloudflared. If it's missing, the preview offers to install it with Homebrew.

Terminal

$ brew install cloudflare/cloudflare/cloudflared

4

Preview your app

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.

Terminal

$ bundle exec ruby_native preview

Tunnel connected. Scan this QR code:

https://your-tunnel.trycloudflare.com

Ready for the app stores?

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.

Get started

Or continue in your agent.

Need help getting started?

Email me at [email protected] and I'll help you get your app up and running.