Curated list of episodes, bundled to help you on your learning path!
Videos of tech, infrastructure, hardware and software which non-instructional by nature.
Articles around software and tutorials.
Show your love and support while looking fancy.
Got a question or want to chat about a topic? Let's talk!
command: rails s -b 0.0.0.0
command: yarn build:css --watch
command: yarn build --watch
ARG RUBY_VERSIONFROM ruby:$RUBY_VERSIONRUN apk add --no-cache --update build-base \ bash \ git \ postgresql-dev \ nodejs \ yarn \ imagemagick \ vips \ tzdata \ && rm -rf /var/cache/apk/*RUN mkdir -p /appWORKDIR /appCOPY Gemfile Gemfile.lock ./COPY package.json yarn.lock ./RUN gem update --systemRUN bundle install -j $(nproc)RUN yarn install
docker buildx build -f Dockerfile --platform linux/amd64 -t registry/app_name:tag --push .
bundle add better_errors
ppm-app-1 | Could not find better_errors-2.9.1, coderay-1.1.3 in any of the sources
ppm-app-1 | Run `bundle install` to install missing gems.
ppm-app-1 exited with code 7
docker compose run --rm app bundle install
I found problem i think, Gemfile.lock file contains nokogiri. When moving Gemfile.lock and bundle install then problem solved.
/usr/local/bundle/gems/nokogiri-1.13.6-aarch64-linux/lib/nokogiri/extension.rb:7:in `require_relative': Error loading shared library ld-linux-aarch64.so.1: No such file or directory (needed by /usr/local/bundle/gems/nokogiri-1.13.6-aarch64-linux/lib/nokogiri/3.1/nokogiri.so) - /usr/local/bundle/gems/nokogiri-1.13.6-aarch64-linux/lib/nokogiri/3.1/nokogiri.so (LoadError)
rails-js-1 | You installed esbuild on another platform than the one you're currently using.
rails-js-1 | This won't work because esbuild is written with native code and needs to
rails-js-1 | install a platform-specific binary executable.
rails-js-1 | Specifically the "esbuild-darwin-arm64" package is present but this platform
rails-js-1 | needs the "esbuild-linux-arm64" package instead. People often get into this
rails-js-1 | situation by installing esbuild on Windows or macOS and copying "node_modules"
rails-js-1 | into a Docker image that runs Linux, or by copying "node_modules" between
rails-js-1 | Windows and WSL environments.
Also worth noting is the difference between "mapping" ports vs "exposing" ports in a Compose file. When mapping a port (e.g., `- 3000:3000` for the Rails app), you are mapping the port on your local machine to a port on the container. If you only expose a port (e.g., `- 5432` for the database service), Compose maps a random port on your machine to the port on the container. To determine what that random port is, you can run `docker compose ps`.
In the end, your docker-compose.yml file could look like this:
I think that some have complained about Docker being slow even on the M1, but I never noticed those kinds of issues with taking 30 seconds or more for pages to load. I've never had to use Mutagen to get things synchronizing quickly. Maybe I'll give the gitlab oss repo a shot one day and see. I believe they have a docker config for development.
After installing the docker on my linux, the docker compose give me an error like:
⠿ Container rails7-postgres-1 Running 0.0s
⠿ Container rails7-redis-1 Running 0.0s
Could not find nokogiri-1.12.5, mini_portile2-2.6.1 in any of the sources
Run `bundle install` to install missing gems.
Then, i try to run
docker compose run --rm app bin/rails bundle install
But it is still same. how can i solve the problem?
I could not change the Dockerfile.dev. It is as in the source file.
Also, my docker version is Docker version 20.10.9, build c2ea9bc90b
Where and how can we change the environment property when we use this docker?
What should we do if we want to leave the development mode and switch to the production mode?
Side note, this is the command that I use to build for different platforms and CPUs.
Then in your docker-compose.yml file, pass only the Ruby version:
The reason for doing this is the Dockerfile uses Alpine-specific commands for installing packages (apk instead of apt). If someone passes in "2.6.8-buster" then they've broken the Dockerfile and the build will fail.
I create a project with `rails new -j esbuild --css bootstrap`, and the rails version is 7 alpha 2.
But the first different I found was, I don't have the `scripts` lines in package.json, so I can't run bin/dev , yarn alert with `build and build:css not found`.
What does that mean? Did you remove the Gemfile.lock? I'm seeing similar errors to your and would appreciate the help.
By the way, I also got an error related to yarn:
RUN apk add --no-cache --update \
Based on [this issue](https://github.com/sparklemotion/nokogiri/issues/2430)
Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "yarn": executable file not found in $PATH: unknown