[Rails / Docker] What to do if access is denied by the browser (localhost: 3000) after adding a gem

environment

macOS 10.15.5 Rails 5.2.4.2 Docker 19.03.12

What to do if access is denied on your browser (localhost: 3000) after adding a gem

When trying to add pagination function in Docker environment, add the following gem and then execute `bundle install` to restart the server ...

gemfile


gem 'kaminari'

terminal


$ bundle install
$ docker-compose restart

But the browser denied access ...

スクリーンショット 2020-11-06 22.40.07.png

Docker operation check

First of all, when you execute `` `docker-compose up```, it was confirmed that Docker has crashed, so try the following operation to connect to the browser again.

terminal


$ docker-compose build

Then run docker-compose up again.

terminal


$ docker-compose up

Then I think that the connection to the browser can be successful even with the gem added! Try it if it crashes when adding a gem in the Docker environment.

Recommended Posts

[Rails / Docker] What to do if access is denied by the browser (localhost: 3000) after adding a gem
What to do if Cloud9 is full in the Rails tutorial
What to do if the background image is not applied after deployment
What to do if the Rails server can't start
What to do if you get an "A server is already running." Error when you try to start the rails server
What to do if the update does not take effect after deploying Rails AWS
[Rails] Processing after adding a column to the devise table
[Solution] What to do if you get a Docker error'ERROR: Cannot connect to the Docker daemon at unix: ///var/run/docker.sock. Is the docker daemon running?'
What to do if you can't use the rails command
What to do when Rails on Docker does not reflect controller changes in the browser
[Ubuntu 20.04] What to do if the external monitor is not recognized
What to do if you get a gcc error in Docker
[Rails] What to do if data is not registered in DB
What to do if the Rails page doesn't appear in Rails tutorial 1.3.2
What to do if the Eclipse Maven dependency Jar is wrong
[Note] What to do if bundle install in Chapter 3 of the rails tutorial is not possible
What to do if the log using JUL is no longer output to the app log after deploying the Spring Boot app to Tomcat as a war
What to do if the prefix c is not bound in JSP
What to do if you don't like the code generated by swagger-codegen-cli
What to do if you can't bundle update and bundle install after installing Ruby 3.0.0 in the Rails tutorial
What to do if Operation not permitted is displayed when you execute a command in the terminal
[Gradle] [checkstyle] What to do if the active setting of Checkstyle is removed by "Refresh Gradle project" from Eclipse
What to do if you get a SQLite3 :: BusyException: database is locked error
What to do if you can't activate the select box created by bootstrap-select
[Swift] What to do if the app icon is set but not reflected
What to do if you get To install the missing version, run `gem install bundler: 2.1.4`
What to do if the rails server doesn't run out on AWS cloud9
What to do about "A server is already running ..." that happened without turning off the rails server in the terminal
After installing'devise''bootstrap' of gemfile with rails, what to do when url is an error
What to do when Address already in use is displayed after executing rails s
What to do if you can't find your API key after deploying to Rails heroku
What to do if the breakpoint is shaded and does not stop during debugging
What to do if rails server can't be stopped
What to do if you accidentally create a model
What to do when rails creates a 〇〇 2.rb file
[Maven] What to do if you are asked to incorporate a jar that is not in the remote repository into the war
[Rails] What to do when rails db: migrate cannot be done because there is no table referenced by the foreign key
[Rails] What to do if you accidentally install bundle in the production environment in your local environment
What to do if you change the Listen Address from the settings screen with Mattermost docker
[Rails Tutorial Chapter 2] What to do when you make a mistake in the column name
[Rails] What to do if you can't get an error message with the errors method
What to do if you get a "302" error in your controller unit test code in Rails
[Rails 6] What to do when a missing a template error occurs after introducing haml [Super easy]
What to do if you get a java.io.IOException in GlassFish
What to do if FacesMessage is set but not displayed
# What to do if you accidentally do rails db: migrate: drop
What to do if the adb command cannot be executed
What to do if mysql2 gets a bundle install error
What do you need after all to create a web application using java? Explain the mechanism and what is necessary for learning
What is Rails gem devise?
What to do if you get a "Mysql2 :: Error: Operand should contain 1 column (s)" error in Rails
How to build an environment with Docker, which is the minimum required to start a Rails application
[Java] What to do if a lot of "File is opened too much" is displayed due to FileNotFoundException
What to do about the "cannot be read or is not a valid ZIP file" error
What to do when javax.el.ELException: Not a Valid Method Expression: appears when the JSF screen is displayed
What to do if validation doesn't work with the update action
What to do if you get a DISPLAY error in gym.render ()
What to do if you forget the root password in CentOS7
What to do if you cannot roll back the migration (UnknownMigrationVersionError)
[Rails] What to do if you can't get parameters with form_with
What to do if zip dies if there is a pom when making an executable jar with gradle