Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@freestyle-sh/with-ruby

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@freestyle-sh/with-ruby

Ruby runtime via [RVM](https://rvm.io) for [Freestyle](https://freestyle.sh) VMs.

latest
npmnpm
Version
0.2.11
Version published
Maintainers
2
Created
Source

@freestyle-sh/with-ruby

Ruby runtime via RVM for Freestyle VMs.

Installation

npm install @freestyle-sh/with-ruby freestyle

Usage

import { freestyle } from "freestyle";
import { VmRuby } from "@freestyle-sh/with-ruby";

const { vm } = await freestyle.vms.create({
  with: {
    ruby: new VmRuby(),
  },
});

const res = await vm.ruby.runCode({
  code: "require 'json'; puts JSON.generate({ hello: 'world' })"
});

console.log(res);
// { result: { hello: 'world' }, stdout: '{"hello":"world"}\n', statusCode: 0 }

Options

new VmRuby({
  version: "3.3.6", // Optional: specific Ruby version (default: "3.4.8")
})
OptionTypeDefaultDescription
versionstring"3.4.8"Ruby version to install via RVM.

API

vm.ruby.runCode({ code: string })

Executes Ruby code in the RVM-managed Ruby runtime.

Returns: Promise<RunCodeResponse>

type RunCodeResponse<Result> = {
  result: Result;      // Parsed JSON from stdout (if valid JSON)
  stdout?: string;     // Raw stdout output
  stderr?: string;     // Raw stderr output
  statusCode?: number; // Exit code
};

vm.ruby.install(options?)

Installs gems via gem install or bundle install.

Returns: Promise<InstallResult>

// Install specific gems
await vm.ruby.install({ deps: ["nokogiri", "colorize"] });

// Install from Gemfile (bundle install)
await vm.ruby.install();
await vm.ruby.install({ directory: "/app" });
type InstallOptions =
  | { deps: string[] }
  | { directory?: string; deps?: undefined };

type InstallResult = {
  success: boolean;
  stdout?: string;
  stderr?: string;
};

Documentation

FAQs

Package last updated on 21 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts