First of all, I know this error has already been listed here, but the question was different.
I have a Rails 4 app, that I used to run on Puma.
Then, a friend of mines worked on the app, and recommended that we use Foreman instead.
So, I used to run the app locally with rails s
in Terminal.
Now, I am supposed to do it with foreman start
.
The problem is, almost every time I try to launch the app, I get the following error:
foreman start
08:42:28 web.1 | started with pid 3398
08:42:28 web.1 | [3398] Puma starting in cluster mode...
08:42:28 web.1 | [3398] * Version 2.13.4 (ruby 2.2.1-p85), codename: A Midsummer Code's Dream
08:42:28 web.1 | [3398] * Min threads: 5, max threads: 5
08:42:28 web.1 | [3398] * Environment: development
08:42:28 web.1 | [3398] * Process workers: 2
08:42:28 web.1 | [3398] * Preloading application
08:42:31 web.1 | [3398] * Listening on tcp://0.0.0.0:3000
08:42:31 web.1 | /Users/TXC/.rvm/gems/ruby-2.2.1/gems/puma-2.13.4/lib/puma/binder.rb:231:in `initialize': Address already in use - bind(2) for "0.0.0.0" port 3000 (Errno::EADDRINUSE)
08:42:31 web.1 | from /Users/TXC/.rvm/gems/ruby-2.2.1/gems/puma-2.13.4/lib/puma/binder.rb:231:in `new'
08:42:31 web.1 | from /Users/TXC/.rvm/gems/ruby-2.2.1/gems/puma-2.13.4/lib/puma/binder.rb:231:in `add_tcp_listener'
08:42:31 web.1 | from /Users/TXC/.rvm/gems/ruby-2.2.1/gems/puma-2.13.4/lib/puma/binder.rb:98:in `block in parse'
08:42:31 web.1 | from /Users/TXC/.rvm/gems/ruby-2.2.1/gems/puma-2.13.4/lib/puma/binder.rb:84:in `each'
08:42:31 web.1 | from /Users/TXC/.rvm/gems/ruby-2.2.1/gems/puma-2.13.4/lib/puma/binder.rb:84:in `parse'
08:42:31 web.1 | from /Users/TXC/.rvm/gems/ruby-2.2.1/gems/puma-2.13.4/lib/puma/runner.rb:119:in `load_and_bind'
08:42:31 web.1 | from /Users/TXC/.rvm/gems/ruby-2.2.1/gems/puma-2.13.4/lib/puma/cluster.rb:304:in `run'
08:42:31 web.1 | from /Users/TXC/.rvm/gems/ruby-2.2.1/gems/puma-2.13.4/lib/puma/cli.rb:215:in `run'
08:42:31 web.1 | from /Users/TXC/.rvm/gems/ruby-2.2.1/gems/puma-2.13.4/bin/puma:10:in `<top (required)>'
08:42:31 web.1 | from /Users/TXC/.rvm/gems/ruby-2.2.1/bin/puma:23:in `load'
08:42:31 web.1 | from /Users/TXC/.rvm/gems/ruby-2.2.1/bin/puma:23:in `<main>'
08:42:31 web.1 | from /Users/TXC/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
08:42:31 web.1 | from /Users/TXC/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
08:42:31 web.1 | exited with code 1
08:42:31 system | sending SIGTERM to all processes
How can I fix this?
—————
UPDATE: I also tried both things below, as recommended here:
ps aux | grep rails
3547 0,0 0,0 2434840 752 s000 S+ 8:48 0:00.00 grep rails
But there is no ruby bin/rails server
and that:
lsof -wni tcp:3000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ruby 808 TXC 8u IPv4 0x4f6da234a6116dab 0t0 TCP *:hbci (LISTEN)
ruby 809 TXC 8u IPv4 0x4f6da234a6116dab 0t0 TCP *:hbci (LISTEN)
ruby 810 TXC 8u IPv4 0x4f6da234a6116dab 0t0 TCP *:hbci (LISTEN)
but I am not sure of what I am supposed to do with this.
Am I supposed to restart my computer every time I want to launch the app locally?