Using the Ruby Runtime with Vercel Functions
The Ruby runtime is used by Vercel to compile Ruby Vercel functions that define a singular HTTP handler from files within an directory at your project's root.
Ruby files must have one of the following variables defined:
- proc that matches the signature.
- class that inherits from the class.
For example, define a file inside a directory as follows:
An example index.rb file inside an
/api directory.
Inside a define:
An example Gemfile file that defines
cowsay as a dependency.
New deployments use Ruby 3.3.x as the default version.
You can specify the version of Ruby by defining in a , like so:
If the patch part of the version is defined, like
3.3.1 it will be ignored and assume the latest
3.3.x.
This runtime supports installing dependencies defined in the . Alternatively, dependencies can be vendored with the command (useful for gems that require native extensions). In this case, dependencies are not built on deployment.
Was this helpful?