Ruby web framework libraries

Updated Nov 2026

Ruby web frameworks receive HTTP requests, route them to Ruby code, and return HTML or JSON responses. A microframework handles routing and responses and leaves database and template layers to separate libraries. These libraries let teams build web apps and APIs in Ruby.

Popularity

Rails has the most monthly downloads in this comparison, at 819394975.

LibraryMonthly downloadsStarsLast releaseLicense
Rails
819394975
59.1KNov 2026MIT
Sinatra
364942330
12.5KNov 2026MIT
Grape
87867545
10.0KOct 2026MIT
Roda
22731529
2.2KNov 2026MIT
Padrino
1744337
3.4KNov 2026MIT
Hanami
1287349
6.4KAug 2026MIT
Cuba
543682
1.4KJan 2024MIT
Downloads: RubyGems, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Provides an integrated model, view, and controller framework for database-backed web applications.

Downloads / mo
819394975
Stars
59.1K
Last release
8.1.4.1
License
MIT

Strengths

  • Integrates models, views, and controllers. Build database-backed applications within one coordinated framework.
  • Serves HTML and JSON responses. Return templates or structured data from a controller.

Limitations

  • Redirects do not halt execution. Return explicitly when later action code should not run.
  • Streaming uses a separate thread. Keep shared request state thread-safe.

Quickstart

From README.md
$ gem install rails
rails new myapp
cd myapp
bin/rails server

Rails examples

From open-source projects on GitHub
def show
    @agent = current_user.agents.find(params[:id])

    respond_to do |format|
      format.html
      format.json { render json: @agent }
    end
  end

Defines web application routes using Ruby blocks and Rack-compatible application classes.

Downloads / mo
364942330
Stars
12.5K
Last release
4.2.2
License
MIT

Strengths

  • Declares routes beside handler code. Pair an HTTP method and path with a Ruby block.
  • Hosts several modular apps together. Subclass Sinatra::Base for multiple apps in one Ruby process.

Limitations

  • Earlier matching routes win. Put specific routes before broader patterns.
  • Changes require reload or restart. Restart the process or add a code reloader.

Quickstart

From README.md
$ gem install sinatra rackup puma
require 'sinatra'
get '/' do
  'Hello world!'
end

Sinatra examples

From open-source projects on GitHub
def show(page, layout = true)
      response["Cache-Control"] = "max-age=0, private, must-revalidate"
      begin
        erb page.to_sym, {:layout => layout}, :resque => Resque
      rescue Errno::ECONNREFUSED
        erb :error, {:layout => false}, :error => "Can't connect to Redis! (#{Resque.redis_id})"
      end
    end

Provides a Ruby framework for API development.

Downloads / mo
87867545
Stars
10.0K
Last release
4.1.0
License
MIT

Quickstart

From README.md
$ gem install grape
require 'grape'
class App < Grape::API
  format :json
  get :hello do
    { hello: 'world' }
  end
end
run App

Matches requests through a Ruby routing tree with optional feature plugins.

Downloads / mo
22731529
Stars
2.2K
Last release
3.110.0
License
MIT

Strengths

  • Shares work across routing branches. Set common state once before handling nested paths.
  • Adds layouts through render plugin. Use view to apply layouts around rendered templates.

Limitations

  • Empty responses default to 404. Set an explicit status for successful responses with empty bodies.
  • Route introspection needs another plugin. Add roda-route_list and annotate routes to inspect them.

Quickstart

From README.rdoc
$ gem install roda
require "roda"
class App < Roda
  route do |r|
    r.root { "Hello world!" }
  end
end
run App

Roda examples

From open-source projects on GitHub
def return_response(body=nil)
      response.write(body) if body
      request.halt
    end

Provides a full-stack framework on top of Sinatra.

Downloads / mo
1744337
Stars
3.4K
Last release
0.18.5
License
MIT

Quickstart

From README.rdoc
$ gem install padrino
require 'padrino-core'
class App < Padrino::Application
  get('/') { 'Hello world!' }
end
run App

Combines separate routing, action, view, database, and asset libraries into a full-stack framework.

Downloads / mo
1287349
Stars
6.4K
Last release
3.0.2
License
MIT

Strengths

  • Keeps actions in separate classes. Give each endpoint its own request-handling object.
  • Escapes rendered template strings automatically. Ordinary strings are escaped; HTML-safe strings bypass escaping.

Limitations

  • Invalid parameters need explicit handling. Check request.params.valid? and halt before using invalid input.

Quickstart

From README.md
$ gem install hanami
hanami new bookshelf
cd bookshelf && bundle
bundle exec hanami dev

Hanami examples

From open-source projects on GitHub
def git_latest_link
        settings = Hanami.app[:settings]

        link_to "Latest (ahead of #{settings.git_tag})",
                "https://github.com/usetrmnl/terminus/commit/#{settings.git_latest_sha}",
                class: :link
      end

Cuba is a microframework for web applications.

Downloads / mo
543682
Stars
1.4K
Last release
4.0.3
License
MIT

Quickstart

From README.md
$ gem install cuba
require "cuba"
Cuba.define do
  on root do
    res.write "Hello world!"
  end
end
run Cuba

FAQ

Rails suits database-backed applications built in one integrated framework. Sinatra suits small apps that pair routes with Ruby blocks. Roda suits apps that share work across nested routing branches.

Rails provides an integrated model, view, and controller framework for database-backed web applications. Its controllers return HTML templates or JSON.

Sinatra defines web application routes with Ruby blocks. Subclasses of Sinatra::Base run several modular apps in one Ruby process.

Hanami combines separate routing, action, view, database, and asset libraries into a full-stack framework. Each endpoint gets its own action class.

Rails suits applications that want models, views, and controllers in one framework. Sinatra suits apps that declare routes beside handler code.

For coding agents

Found your web framework library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official