Installation
Grape is a REST-like API framework for Ruby. It's designed to run on Rack or complement existing web application frameworks such as Rails and Sinatra by providing a simple DSL to easily develop RESTful APIs.
Prerequisites
Before installing Grape, ensure you have the following prerequisites met:
- Ruby: Version 3.0 or newer is required.
Dependencies
Grape has the following runtime dependencies, which will be automatically installed:
activesupport >= 7.0
dry-types >= 1.1
mustermann-grape ~> 1.1.0
rack >= 2
zeitwerk
Gem Installation
Grape is available as a RubyGem. The recommended way to install it is through Bundler.
-
Add Grape to your project's
Gemfile
:gem 'grape'
-
Install the gem using Bundler:
bundle install
Alternatively, you can install it directly using the
gem
command, but using Bundler is recommended for managing project dependencies:gem install grape
Next Steps
With Grape installed, you're ready to create your first API. Head over to the Quick Start guide to build a simple application.