Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: cannot run multiple consoles via docked rails c #18

Open
alexspark opened this issue Jan 10, 2023 · 6 comments · May be fixed by #34
Open

Bug: cannot run multiple consoles via docked rails c #18

alexspark opened this issue Jan 10, 2023 · 6 comments · May be fixed by #34

Comments

@alexspark
Copy link

Given I already have a live console via docked rails c, I cannot start an additional rails console with docked rails c.

The error I receive is:

docker: Error response from daemon: driver failed programming external connectivity on endpoint vigorous_hertz (be93a27e17aba8081f1a9cb781f7a6f38b7fa1e6f8535fa3f474a1d9eed39b99): Bind for 0.0.0.0:3000 failed: port is already allocated.

@ginzunza
Copy link

ginzunza commented Jan 10, 2023

You are having that problem because the docked alias is using port 3000. You should be able to open multiple consoles using the command without specifying a port:
docker run --rm -it -v ${PWD}:/rails -v ruby-bundle-cache:/bundle ghcr.io/rails/cli rails console
In addition, you could add this alias to avoid the command above:
alias rails-console='docker run --rm -it -v ${PWD}:/rails -v ruby-bundle-cache:/bundle ghcr.io/rails/cli rails console'

@alexspark
Copy link
Author

ah that makes sense!

perhaps the README suggestion for the docked alias should not include -p 3000:3000 since it is only really useful for server and bin/dev CLI commands.

@dhh
Copy link
Member

dhh commented Mar 4, 2023

Why do you need to run multiple consoles?

@alexspark
Copy link
Author

I have multiple consoles running b/c I'm debugging different things in the application. It helps to have the related history of commands within a single console.

@pjar
Copy link

pjar commented Mar 11, 2023

Another option would be to get into running container. I start with docked rails server, then I get list of running containers docker ps to find name of the running container and by docker exec -it <container_name> rails c. You can do it in as many terminals as needed.

@durierem durierem linked a pull request Mar 25, 2024 that will close this issue
@baozoudashijian
Copy link

when i was running "docked rails new weblog" it throw a error it like this "/usr/local/lib/ruby/3.3.0/fileutils.rb:402:in `mkdir': Permission denied @ dir_s_mkdir - /rails/weblog (Errno::EACCES)", please help me solove this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants