Closed KellyAH closed 4 years ago
LGTM! I was able to make changes to the code & have it reflect in localhost
I ran the script and this is the error I received:
rails aborted!
Errno::ENOENT: No such file or directory - bs_fetch:atomic_write_cache_file:chmod
/usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/iseq.rb:37:in fetch' /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/compile_cache/iseq.rb:37:in
load_iseq'
/usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in require' /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in
block in require_with_bootsnap_lfi'
/usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in register' /usr/local/bundle/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in
require_with_bootsnap_lfi'
It worked fine on Karolina's mac but not on Neer's when running the script. Yet on Neer's machine we were able to successfully spin up the image with an open shell session and run the same commands in the script that create the DB and start the server.
Something about the script and maybe Docker and Neer's mac? is preventing the script from working and throwing the error she posted.
Problem
Neer couldn't get the dev enviroment app running in a docker container. Because her local and my local repo files were different and the dockerfile did not account for that. See https://github.com/KellyAH/friend-reminder-app/pull/1 for more info.
Fix
I did as Julian F. recommended and created a bash script that runs through all the setup steps.
Warning
The bind mount seems to be bi-directional so, some files will be auto copied to your local repo.
Such as these:
It seems to be mainly tmp files and the database which was created in the container when migration scripts are run and the server is started.
These files are ignored by git so they shouldn't be junking up the detected git changes.
If you prefer to now have this happen, please leave a comment so I can investigate how to avoid this.
Tests
Tested on my local by repeatedly deleting my local repo, pulling a fresh clone of it, and ran the script several times in a row:
You can test it by doing this:
cd [repo_name]
sh script/setup_dev_env.sh
<h1>My Friends</h1>
in app/views/friends/index.html.erb