> docker compose up
# ERROR [superline-worker internal] load metadata for docker.io/library/ruby:3.2.2-slim
# Unknown desc = failed to fetch oauth token: Post "https://auth.docker.io/token": Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.)
> docker pull ruby:3.2.2-slim
> docker compose run app bundle install
# Net::HTTPServerException: 407 "Proxy Authentication Required
IN C:\Users\c510268\.docker\config.json
"proxies": {
"default": {
"httpProxy": "http://c510268:[email protected]:80",
"httpsProxy": "http://c510268:[email protected]:80",
"noProxy": "localhost, 127.0.0.0/8"
}
}
RUN SECRET_KEY_BASE=skb DB_ADAPTER=nulldb bundle exec rails assets:precompile
# Now running OK
WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see jemalloc/jemalloc#1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot.
or
Those errors happens when you have incorrect line endings in some of your files.
-
on Windows:
(Git is set up to automatically convert EOL characters to CRLF)Go to the file that gives you the error (./bin/importmap in my case).
Change the file EOL endings from CRLF to LF (with Notepad++, Sublime or VisualStudio)
VisualStudio example: At the right bottom of the screen there is a little button that says “LF” or “CRLF”:
Select LF and save. Run you command again.
Optionally:
Make Git retain original EOL characters (disabling autocrlf).
Specify EOL type in .gitattributes with text eol=lf
or Disable autocrlf in Git's config file (.gitconfig) with autocrlf=false
.
(making Git retain original EOL characters).
(ActiveRecord::NoDatabaseError: We could not find your database: mbusch_production. Which can be found in the database configuration file located at config/database.yml)
- docker compose run -it --rm app bundle exec rails db:create
docker compose exec -it postgres bin/sh
# psql -U <your DB-USER>
# create database mbusch_production;
- Restart docker compose.
docker compose run --rm -it app yarn build
docker compose run --rm -it app bundle install
- Rails 7 with importmaps woudn't need any js runtime (node.js or other)
- Some gem that are requiring execjs. Check your gemfile.lock.
- In my case were:
- autoprefixer-rails (Required by bootstrap.)
- babel-transpiler (Required by spree-frontend and spree-backend.)
- terser
So, you have to install node.js if you want these gems to work.
In your dockerfile:
# INSTALL NODE
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
# INSTALL YARN
&& npm install -g yarn
- For Rails users >= 7.0.3.1, ActiveRecord 7.0.3.1 changed an internal call and it now calls safe_load directly. If you see a Psych related error during rails tests, you might be affected by this change. (See https://discuss.rubyonrails.org/t/cve-2022-32224-possible-rce-escalation-bug-with-serialized-columns-in-active-record/81017)
To resolve it, you can add this to a new or existing initializer:
# In config/initializers/activerecord_yaml.rb
ActiveRecord.use_yaml_unsafe_load = true
# or
config.activeRecord.use_yaml_unsafe_load = true
# Or you may also use ActiveRecord.yaml_column_permitted_classes to configure the allowed classes instead.
config.active_record.yaml_column_permitted_classes = [Symbol, Date, Time]
- Another solution is to downgrade up to ruby 3.0.3 wich is the last version that doesn't uses Psych 4.
or
docker compose run --rm -it app yarn build
docker compose run --rm -it app ./bin/rails javascript:install:esbuild
*Because you are pushing from windows
git rm --cached .env
Uncaught TypeError: El especificador “popper” era un especificador básico, pero no se reasignó a nada.
(Los especificadores de módulos relativos deben comenzar con “./”, “../” o “/”.)
- gem "bootstrap" (in Gemfile)
-
docker compose run --rm web bundle install