Appreciate you testing the Ruby agent beta!
It looks like the error you’re encountering is due to a missing openid_connect gem, which is required internally by the agent for authentication purposes.
To check whether this gem is properly installed in your project, you can run the following command
bundle show openid_connect
If the gem is not found, it’s likely because only forest_admin_rails was added to your Gemfile. However, this gem doesn’t include all required dependencies by itself.
To install the full Ruby agent properly, please make sure to add all the following gems:
Since the gem was correctly installed, the issue came from how the OpenIDConnect constant is loaded. In some setups (depending on the loading order and environment), it may not be automatically available when the controller is loaded.
We’ve fixed this on our side by explicitly requiring the gem at the top of the forest_controller.rb file.
The patch has been released in version v1.0.0-beta.104 — you can update to that version to resolve the issue.
Thanks @matthv. I upgraded the gem but now I get the following errors when trying to load the dashboard:
../gems/ruby-3.4.4/gems/forest_admin_rails-1.0.0.pre.beta.104/app/controllers/forest_admin_rails/forest_controller.rb:54:in ‘ForestAdminRails::ForestController#exception_handler’: undefined method ‘name’ for an instance of ForestAdminAgent::Error (NoMethodError)
name: exception.name,
../gems/ruby-3.4.4/gems/forest_admin_agent-1.0.0.pre.beta.104/lib/forest_admin_agent/services/ip_whitelist.rb:96:in ‘ForestAdminAgent::Services::IpWhitelist#fetch_rules’: Cannot retrieve the data from the Forest server. An error occured in Forest API (ForestAdminAgent::Error)
It looks like we’re hitting a similar issue as before, this time with how the ForestAdminAgent::Error class is used. A patch is currently in progress to address this.
The issue related to IpWhitelist is usually caused by a misconfiguration of the ‘FOREST_ENV_SECRET’ variable, could you please double check the value present inside of your config.env_secret and also share with me the last 4 chars of your secret ?
you should have executed the command using the FOREST_ENV_SECRET defined inside your previous agent
rails g forest_admin_rails:install [FOREST_ENV_SECRET]
I upgraded but still get the error about the IP whitelist feature:
DEBUG – : {error: “undefined method ‘’ for nil”, status: 404, response: “{"errors":[{"status":404,"detail":"Not found error","name":"NotFoundError"}]}”}
D, [2025-06-13T11:39:29.920638 #4644] DEBUG – : /Users/xxx/.rvm/gems/ruby-3.4.4/gems/forest_admin_agent-1.0.0.pre.beta.106/lib/forest_admin_agent/services/ip_whitelist.rb:101:in ‘ForestAdminAgent::Services::IpWhitelist#fetch_rules’: Cannot retrieve the data from the Forest server. An error occured in Forest API (ForestAdminAgent::Error)
/.rvm/gems/ruby-3.4.4/gems/forest_admin_agent-1.0.0.pre.beta.106/lib/forest_admin_agent/services/ip_whitelist.rb:91:in ‘ForestAdminAgent::Services::IpWhitelist#fetch_rules’: undefined method ‘[]’ for nil (NoMethodError)
ip_whitelist_data = body[‘data’][‘attributes’]
Note that I haven’t configured any ip_whitelist in the dashboard. I just have the following config in config/application.rb (I tried to remove it but same errors):
# ForestAdmin CORS configuration
null_regex = Regexp.new(/\Anull\z/)
config.middleware.insert_before 0, Rack::Cors do
allow do
hostnames = [null_regex, 'localhost:4200', 'app.forestadmin.com', 'localhost:3001']
hostnames += ENV['CORS_ORIGINS'].split(',') if ENV['CORS_ORIGINS']
origins hostnames
resource '*',
headers: :any,
methods: :any,
expose: ['Content-Disposition'],
credentials: true
end
end
Would you mind sharing the code of your Word model so we can take a closer look? That should help us understand what’s going wrong.
Also, can you confirm the name of the corresponding table in your database?
It doesn’t seem to be directly related to your Word model, but more likely to a customization issue in your agent setup.
Could you try commenting out the customize call inside the self.setup! method in the app/lib/forest_admin_rails/create_agent.rb file (or the entire self.customize method)?
There might be a typo or an unexpected error in your customization that’s preventing the agent from initializing properly.
PG::GroupingError (ERROR: column "comments.created_at" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: SELECT DATE_TRUNC('day', created_at) AS "created_at", count(...
^
)
I uncommented the “customize” section in create_agent.rb, so I guess the issue is from the gem’s code.