Open 0xAdriaTorralba opened 2 months ago
Can you verify this @pourmand1376? I don't have access to a Mac.
Hey Guys.
I tested on M1 Mac and I really couldn't figure out the issue.
Here's what I've done.
docker compose pull
docker compose up
Is there any way to replicate your issue?
The issue is not related to local development, but when you try to deploy this website to Github Actions, see here an instance of a failed build when you push your changes from local.
Again, local development is just fine using the docker compose
.
Maybe this is related to #2682, #2544?
Maybe. I just don't understand why Gemfile is updated in @0xAdriaTorralba repository.
Can you explain how you updated your Gemfile.lock file and what was the reason?
Maybe this is related to #2682, #2544?
Yes, it seems so. I got those issues before updaing the Gemfile.lock
Can you explain how you updated your Gemfile.lock file and what was the reason?
The way I managed to update the Gemfile.lock is by doing the step-by-step I added on INSTALL.md
, I paste this again here:
docker exec -it <container_name> sh
)bundle lock --add-platform ruby
bundle lock --add-platform x86_64-linux
rm -rf Gemfile.lock
)bundle install
inside the container.Gemfile.lock
capable of handling builds for both local and production environments.Gemfile.lock
and you should be good to go.The problem here is the following: the first time you run docker compose pull; docker compose up
it is populated using the LOCAL development environment, so, it lists and adds the proper items to Gemfile.lock for THAT (local) platform (in my case, ARM-based ones). HOWEVER, it may be the case that the PRODUCTION environment architecture is DIFFERENT from your local one (this is my case, and also the cases on issues #2682, #2554). In this case, you need to rebundle the Gemfile.lock to consider this platform target. Is it clear now?
Somehow its Gemfile.lock is apparently being overwritten and commited to the repo, which I believe it shouldn't. We have Gemfile.lock versioned here and also added to the .gitignore. Also if you look at the versioned Gemfile.lock we have
which is the version you just locked into.
@0xAdriaTorralba
OK. Thanks for explanation. I think a better workaround is that you don't commit Gemfile.lock
to the repository and it remains the same instead of changing it everytime. Does that solve your problem?
For that before any commit do this:
git restore Gemfile.lock
@george-gca And About .gitignore
. Adding a file to gitignore won't work if we already have that file tracked in repository.
Thanks for mentioning that. I think we need to add another PR or change this PR somehow to make that change everytime.
We should add this command somewhere to be run after finishing local deployment:
git restore Gemfile.lock
@0xAdriaTorralba. I created another PR to see if I can solve this issue. #2707. I'll see what I can do (I can even add my changes to this PR if you want).
Thanks for bringing our attention to this bug.
Maybe we should do something like git update-index --assume-unchanged
somewhere? Idk if it would solve the issue, since this flag can't be pushed to the repo.
I merged my change. It should solve this problem.
Trying to deal with building the website using Github Actions, I found a problem related to my local development build being an Apple Silicon Mac.
I found a workaround for this, and I'm sharing and adding the step-by-step to fix the problem, in case you find suitable to include this for the rest of Apple Silicon Mac users :)