[2023-06-10 10:38:59] Forest 🌳🌳🌳 You need to enable caching on your environment to use Forest Admin. For a development environment, run: `rails dev:cache`

Feature(s) impacted

Dashboard not running due to caching issue. Maybe theres something conflicting. I have inhereted this project from another developer who has since left… so im all on my own and my ruby skills are not exactly up to scale. Any help is appreciated. I know im a bit of a noob to this.

Observed behavior

I ran rails dev:cache and it says that it is actively caching but when I run rails s or RAILS_ENV=development rails s I get the message that its not caching and that I should run rails dev:cache.

Expected behavior

I expected when running RAILS_ENV=development rails s for the dashboard to start.

Context

Hi @MikeOcasio, and welcome to our community :wave: ,

When you run the rails dev:cache command, the cache is deactivated if it is already activated and vice versa.

Could you share the log when you run this command and the server log when you start rails.

Also, could you share your network log from your browser when you are at the last step of onboarding?

1 Like

Console from Chrome:

Access to fetch at ‘http://localhost:3006/forest’ from origin ‘https://app.forestadmin.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.
GET http://localhost:3006/forest net::ERR_FAILED 200 (OK)

Running Server log:

[2023-06-13 08:45:10] Forest :deciduous_tree::deciduous_tree::deciduous_tree: You need to enable caching on your environment to use Forest Admin.

For a development environment, run: rails dev:cache

Puma starting in single mode…

*** Version 4.3.12 (ruby 2.6.5-p114), codename: Mysterious Traveller**

*** Min threads: 5, max threads: 5**

*** Environment: development**

*** Listening on tcp://127.0.0.1:3000**

*** Listening on tcp://[::1]:3000**

Log for rails dev:cahe :

Development mode is now being cached.

Is that all the info? let me know if I missed anything.

I figured it out the issue was with the CORS. Updated it to link directly to Forest and now it connected.

1 Like