Im getting an error message NameError: uninitialized constant ElasticAPM::Grape
it looks like there is a check for if constants exist, so the below should not have reported nil
according to line 46 on this file https://github.com/elastic/apm-agent-ruby/blob/c96d6fc99e9392d398c18c070b5f8d8b818e82a4/lib/elastic_apm.rb
## ...
require 'elastic-apm'
p defined?(::Grape) # => "constant"
p defined?(::Sinatra) # => "constant"
p defined?(::ElasticAPM) # => "constant"
p defined?(::ElasticAPM::Sinatra) # => nil
p defined?(::ElasticAPM::Grape) # => nil
## CORS
use Rack::Cors do
allow do
## ...
end
end
## map each app to a root url
app_roots = Rack::URLMap.new(
'/' => AppCore::API,
'/app_two' => AppTwo::API,
'/app_three' => AppThree::API
)
## ...
if ENV['RACK_ENV'] != 'production'
config = YAML.safe_load(File.read('./config/elastic_apm.yml'))
ElasticAPM::Grape.start(AppCore::API, config)
ElasticAPM::Grape.start(AppTwo::API, config)
ElasticAPM::Grape.start(AppThree::API, config)
end
run Rack::Cascade.new [app_roots]
APM Agent language and version:
Ruby 2.6.5
Installed Gems:
gem 'awesome_print'
gem 'aws-sdk', require: ['aws-sdk-s3', 'aws-sdk-ses']
gem 'bitly', '~> 1.1.2'
gem 'bunny', '>= 2.9.2'
gem 'carrierwave'
gem 'carrierwave-aws'
gem 'carrierwave-mongoid', require: 'carrierwave/mongoid'
gem 'dotenv'
gem 'elastic-apm', '~> 1.0'
gem 'elasticsearch', '~> 6.1.0'
gem 'faraday', '~> 0.17.1'
gem 'faraday_middleware'
gem 'faraday_middleware-aws-sigv4', require: 'faraday_middleware/aws_sigv4'
gem 'geocoder'
gem 'gibberish'
gem 'grape'
gem 'grape-entity'
gem 'haml'
gem 'hashie'
gem 'humanize'
gem 'jwe', '0.4.0'
gem 'jwt', '2.2.1'
gem 'kaminari', '~> 1.0'
gem 'kaminari-mongoid', '~> 1.0'
gem 'lob'
gem 'mini_magick'
gem 'monetize'
gem 'money'
gem 'mongoid', '~> 6.4'
gem 'mongoid-encrypted-fields'
gem 'mustache'
gem 'phone'
gem 'postmark', '1.14.0'
gem 'prawn'
gem 'prawn-table'
gem 'pry'
gem 'puma'
gem 'rack'
gem 'rack-contrib'
gem 'rack-cors'
gem 'rack-test'
gem 'rake'
gem 'redis'
gem 'rest-client', require: 'rest_client'
gem 'rspec'
gem 'rubyXL'
gem 'sanitize', '~> 4.5.0'
gem 'sneakers'
gem 'sinatra'
gem 'symmetric-encryption', '~> 3.9.1'
gem 'tux'
gem 'twilio-ruby'