Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Serve Locally After App Creation #3527

Closed
TrimperAlex opened this issue Mar 18, 2023 · 4 comments
Closed

Cannot Serve Locally After App Creation #3527

TrimperAlex opened this issue Mar 18, 2023 · 4 comments

Comments

@TrimperAlex
Copy link

It doesn't feel very good when something fails at the very beginning and you can't find the answer anywhere.....
Following along in the setup I believe I have all the correct prerequesites but I can't serve locally after reating the app. Here's what I did:
Create a new app:
refinerycms testrefinery
CD into file:
cd testrefinery
Serve:
rails server
As basic and straightforward as it gets but my terminal says "Nope"
The error is:

Cannot load `Rails.application.database_configuration`: (Psych::BadAlias)
Unknown alias: default

So I'm just missing something reallly simple right?
I'm a junior developer just figuring things out, any help would be so appreciated, thank you!

@atiqueakhtar
Copy link

Hi @TrimperAlex

It looks like there might be an issue with your database configuration. Here are a few things you can try:

  • Check your database.yml file in the config directory of your app. Make sure that the default section is defined with the correct adapter, database name, username, and password for your local development environment.

  • If the database.yml file looks correct, try running bundle exec rails db:create to create the database for your app.

  • If that doesn't work, try running bundle exec rails db:reset to drop and recreate the database from scratch.

  • If none of the above steps work, you might want to try deleting your Gemfile.lock file and running bundle install again to ensure that all of your dependencies are up to date.

Hopefully one of these steps will help you get your app up and running locally!

@Matho
Copy link
Contributor

Matho commented Mar 19, 2023

Hi @TrimperAlex

The guides are very old and are not updated. I think the issues is due to your used Ruby version. Try to install Ruby 2.6.X and try again.

Alternatively, if you want to only test the Refienery and see, how it looks like, you can check http://demo.refinerycms.com . The admin link is
http://demo.refinerycms.com/refinery and credentials are demo for username and demo for password. Feel free to play with it, the database is restored 2 times per day.

Another way is to fork from my repository https://github.com/Matho/refinerycms-example-app - this is exactly the version which is deployed at demo page.
If you want to start developing and use this repo as base of your project, do not forget to revert few commits, like this one Matho/refinerycms-example-app@6a33b02

If you are familiar with Docker, there is Dockerfile in that repo - https://github.com/Matho/refinerycms-example-app/blob/master/Dockerfile . But by default the Docker is using aarch64 architecture - for Raspberry PI, where I'm hosting the project. If you would like to use Docker on non-Raspberry PI, you will need to change the base image. You will probably find amd64 on Docker Hub, or alternatively you can build your own.

Note: Running projects on Ruby 2.6.X could be problem on newest operating systems. So Docker with old 2.6.X Ruby is a way, but not recommended. You can try to update to latest Ruby 3.2.1 (at the time of writing this reply) - see comments here #3526 . Main branch of the Refinery project dosnt support 3.X.Y yet

@TrimperAlex
Copy link
Author

Thanks @atiqueakhtar, I should've tried any of those things. You're so kind I really appreciate your help.

And thank you @Matho , I am starting to use development environments like docker so I will absolutely give that a try. I am using Ruby 3.1.2 so I will try an older version.

Thanks again!

@LightTemplar
Copy link

LightTemplar commented Oct 31, 2023

Please, reopen the issue. The problem exists because of breaking change in Psych 4, which comes with Ruby 3.1 and Refinery CMS should adapt its code to it:

https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias


Upd.:
I reread issues here and I see, there is already work on upgrading refinery for supporting of Ruby 3.1.x. So, I'm not sure, if this issue should be extra open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants