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

Issue when creating post #4

Open
GustaMatos0 opened this issue Feb 1, 2024 · 4 comments
Open

Issue when creating post #4

GustaMatos0 opened this issue Feb 1, 2024 · 4 comments

Comments

@GustaMatos0
Copy link

Screenshot from 2024-02-01 16-45-12

When clicking on the save and close button, I get this error on the rails server terminal:

Started POST "/blog/admin/posts" for 127.0.0.1 at 2024-02-01 16:43:46 -0300 ActiveRecord::SchemaMigration Load (0.2ms) SELECT schema_migrations.versionFROMschema_migrationsORDER BYschema_migrations.version` ASC
Processing by Bloak::Admin::PostsController#create as JS
Parameters: {"authenticity_token"=>"[FILTERED]", "post"=>{"author_name"=>"G", "author_email"=>"g@home", "published_at"=>"2024-02-01", "title"=>"Test", "cover_image"=>#<ActionDispatch::Http::UploadedFile:0x00007f1f63a8af00 @tempfile=#Tempfile:/tmp/RackMultipart20240201-59618-ey15vb.jpg, @content_type="image/jpeg", @original_filename="favicon.jpg", @headers="Content-Disposition: form-data; name="post[cover_image]"; filename="favicon.jpg"\r\nContent-Type: image/jpeg\r\n">, "topic"=>"word", "summary"=>"Just a test", "content"=>"# Hello TinyMDE!\r\nEdit here", "published"=>"0", "featured"=>"0"}, "commit"=>"Save and Close"}
Completed 500 Internal Server Error in 40ms (ActiveRecord: 4.7ms | Allocations: 36255)

ActiveRecord::StatementInvalid (Mysql2::Error: Table 'mysql_test_development.active_storage_blobs' doesn't exist):

`

@nicbet
Copy link
Contributor

nicbet commented Feb 5, 2024

Hi @GustaMatos0, it's likely that your host application hasn't run ActiveStorage migrations yet when you see this error message. See this section in the README:

The engine contains migrations for the bloak_articles and bloak_images tables which need to be created in the application's database so that the engine's models can query them correctly. To copy these migrations into the application run the following command from the application's root:

$ bin/rails bloak:install:migrations

Additionally, Bloak requires ActiveStorage to be installed in your Rails application to store images for your posts. If you haven't done so yet, now is a good time to run bin/rails active_storage:install. Please note, that Bloak uses the image_processing gem to create thumbnails and image variants, which in turn requires the vips linrary to be installed on your system.

Then, run all migrations within the context of the application with bin/rails db:migrate.

Cheers!

@GustaMatos0
Copy link
Author

GustaMatos0 commented Feb 9, 2024

Hello! Sorry the delay.
I did run the migrations, even retried from the beginning once! I will try again when home (travelling rn, answering in my cell) and I'll get back to you.
Edit: Will also follow a more thorough installation guide if it comes to it.

@GustaMatos0
Copy link
Author

Hello again! I managed to get past that. However, I now get the following error:

Screenshot from 2024-02-09 20-00-25

@nicbet
Copy link
Contributor

nicbet commented Apr 19, 2024

@GustaMatos0 We've just released Bloak 1.0.2 that fixes the deprecation of DateTime.to_s(format) in Rails 7.1 and above and should take care of that error.

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

2 participants