I am trying to introduce Docker into an existing app created with rails6, webpacker4.
When the container is launched, DB connection and HTML display will be done
CSS and bootstrap around the front are not reflected.
Everything around the front has been transferred from the asset pipeline to webpacker.
The fontawesome icon that was read there is displayed, so I think that the webpacker itself is moving,
Why isn't the bootstrap and CSS that are moving to webpacker management reflected?
Please give me advice if you like.
docker-compose run rails where bin/webpack was executed,
ERROR in ./app/fronts/src/stylesheets/application.scss Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): Error: Missing binding /App/node_modules/node-sass/vendor/linux-x64-72/binding.node Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 12.x Found bindings for the following environments: -OS X 64-bit with Node.js 12.x . . . Long log with npm rebuild node-sass . . ERROR in ./node_modules/slick-carousel/slick/slick-theme.scss Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): Error: Missing binding /App/node_modules/node-sass/vendor/linux-x64-72/binding.node Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 12.x Found bindings for the following environments: -OS X 64-bit with Node.js 12.x Long log with npm rebuild node-sass
It will be displayed.
As the log
docker-compose run rails npm rebuild node-sass was the same error.
FROM ruby: 2.5.1 RUN rm/bin/sh&&ln -s/bin/bash/bin/sh RUN apt-get update -qq&&apt-get install -y build-essential libpq-dev RUN apt-get update&&apt-get install -y curl apt-transport-https wget&&\ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add-&&\ echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list&&\ apt-get update&&apt-get install -y yarn RUN curl -SL https://deb.nodesource.com/setup_12.x | bash RUN apt-get install -y nodejs RUN apt-get update&&apt-get install -y mysql-client --no-install-recommends&&rm -rf/var/lib/apt/lists/* RUN mkdir/App WORKDIR/App ADD Gemfile/App/Gemfile ADD Gemfile.lock /App/Gemfile.lock RUN bundle install ADD./App
version: '3' services: rails: build:. command:/bin/sh -c "rm -f tmp/pids/server.pid&&bundle exec rails s -p 3000 -b '0.0.0.0'" volumes: -.:/app_name ports: -"3000: 3000" links: -db db: image: mysql: 5.7.28 environment: MYSQL_ROOT_USER: root MYSQL_ROOT_PASSWORD: password MYSQL_DATABASE: app_development ports: -"3306: 3306"
Answer # 1
I solved it with reference to here.
Since I was ADDing the local as it is, node_modules remains a binary for macOS,
It seems that an error occurred because the container requires a linux binary.
It moved when I created dockerignore and did not have node_modules.
Thank you very much.
- ruby on rails - rails6 rspec integration test error
- ruby on rails 6 - rails6 activerecord :: recordinvalid in userscontroller # update
- ruby on rails - rails6 rspec model run-time error nomethoderror: undefined method `valid?'for nil: nilclass
- ruby on rails - after updating to rails6
- ruby on rails 6 - rails6 gives argumenterror in postscontroller # create
- ruby on rails - [rails6] i want to display the validation error generated by update by index
- ruby on rails 6 - rails6 does not refer to the intended table when cutting the subdirectory under app/model
- ruby on rails - [rails6] actioncable data transfer does not work
- ruby on rails - error when implementing rails6 follow function
- ruby on rails - rails: the combination of devise and simple_form makes the user registration form, and the username value become
- ruby on rails - bootstap 4 does not work in rails6 production environment
- ruby on rails 6 - if you use multiple link_to in rails6 helper, only the last one will be reflected
- ruby on rails - cart function routing error cannot be resolved
- ruby on rails - saved description in nested controller
- ruby on rails - rails s can't
- ruby on rails - how to transition from the top page
- ruby on rails - i want to implement a function for administrator users to register luggage for general users in rails
- ruby on rails - error in controller when transitioning with rails6 destory action
- ruby on rails - things associated with a foreign key cannot be called in view
- ruby on rails 6 - environment construction of ruby on rails
- ruby on rails - i'm trying to create a container in docker but it doesn't work i want to create a container
- ruby on rails - i'm trying to build a rails environment on docker, but it doesn't work
- ruby on rails - how to debug with rails pry in docker environment
- ruby - an error occurs when building a rails 6 environment with docker
- mysql - about $docker exec -it container name/bin/bash of docker
- ruby on rails - [docker] rails s -b 0000 => cannot render console from 1722801!
- after updating docker desktop, local changes are no longer detected
- php - i built an environment with docker and laravel, but i get a 404 file not found
- ruby - unable to create table with foreign key
- web server - about the error that occurred when doing docker-compose up