Install AppMap agent For Ruby

Supported Rails versions: 5.x, 6.x, 7.x

Supported Ruby versions: 2.6, 2.7, 3.0, 3.1

Open a terminal window in the top level folder of your project and run this command:

npx @appland/appmap install-agent

You will be guided through a series of steps for installing and configuring that agent, that will look like this:

$ npx @appland/appmap install-agent
? Select a target language for agent installation. Ruby
✔ Installing the AppMap agent...

   ╭─────────────────────────────────────────────────────────╮
   │                                                         │
   │      Success! The AppMap agent has been installed.      │
   │                                                         │
   │   Run your tests with APPMAP=true in the environment.   │
   │       AppMap files will be output to tmp/appmap.        │
   │                                                         │
   │               For more information, visit               │
   │     https://appland.com/docs/reference/appmap-ruby      │
   │                                                         │
   ╰─────────────────────────────────────────────────────────╯

After you have installed the agent proceed to Record AppMaps.

Manual installation

For installation without Node.js follow this manual installation procedure.

1. Install the AppMap gem

Add gem 'appmap' to your Gemfile as the first entry in the list. We recommend that you add the appmap gem to the :development, :test group. Your Gemfile should look something like this:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# Optional rubRuby version
# ruby '2.7.2'

# insert the appmap gem to the top of the list 
group :development, :test do
  gem 'appmap'
end

# the rest of the gems
gem 'rails',                      '6.1.0'

Install with bundle install.

2. Create a file named appmap.yml in the top level folder of your project

and add your application source code directories and gems. Example:

# 'name' should be the same as the code repo name.
name: my_project
packages:
- path: app/controllers
- path: app/models
- path: lib
# Include the gems that you want to see in the dependency maps.
# This is just an example.
#- gem: cancancan

Was this page helpful? thumb_up Yes thumb_down No
Thank you for your feedback!