Comments (13)
If anyone else reads this issue, tmuxinator is a great alternative that also allows you to start multiple processes. It runs them in different tmux "panes" instead of grouping all of the output, so you are able to use a debugger. Foreman is awesome, but I would highly recommend tmuxinator
for development.
from foreman.
For anyone wanting to use pry in foreman, pry-remote seems to do the trick for me.
from foreman.
If you'd like to run whatever's in your procfile as if you had pasted it into your terminal you can use run
rather than start
and then your interactive apps will work fine. You just can't run more than one app in one terminal.
Procfile
web: bundle exec rails s
$ foreman run web
from foreman.
+10 For the above concern.
More on the commenting the line inside Procfile.
If I just want not to run some process, we all do put #...
for that process not to run, but it does run?
What is the proper way of commenting?
from foreman.
I'm trying to understand how to accomplish the same thing as the author. How do you get access to a debug console when you're running your development setup with foreman?
from foreman.
Same problem as author...
from foreman.
I'm also having this issue when using pry's debugging.
from foreman.
Is it possible to get an interactive debug console while running rails through foreman in development?
You should look at using remote debuggers… I had some limited success, the notion being that somewhere in an initializer for development mode you set something like the following:
Debugger.wait_connection = true
Debugger.start_remote
There's more documentation here - long story short, the wait_connection = true
line should ensure that the debugger pauses for a fixed amount of time (no clue how long) waiting for you to run:
$ rdebug -c
In another terminal, this is how one has to debug when using Passenger, or some other process. I believe that if you skip the wait_remote
line, the debug statements are only effective if you previously ran rdebug -c
and it is waiting for a server to come up.
YMMV, but I think remote debugging is the way to solve this. Perhaps as an issue, if someone figures it out reliably, they could commit some documentation.
(I also can't say anything about Pry, except that as far as I know it's also only a wrapper around ruby-debug
, so the results should be similar.)
from foreman.
Hi leehambley,
That solution works very well indeed! And is some very handy knowledge to have, thank you.
I didn't need to include the Debugger.wait_connection = true
line which may be more useful for short running scripts that would otherwise exit before you connect.
The only other complication I had in my setup was that I'm running guard-spork which is using drb on port 8989 as well. I used Debugger.start_remote(nil, 8991)
and rdebug -c -p 8991
. You could also change guard-spork to use another port.
Thanks again for this info, this will come in very handy.
from foreman.
@dunkstewart Can you post a wiki according to your setup so that it would be easy enough for others?
from foreman.
@dunkstewart I removed the Debugger.wait_connection = true
as well since it was causing issues with nginx. Now I can connect to any of my load balanced instances with the debugger. Thanks guys! @leehambley
from foreman.
For anyone wanting to use pry in foreman, pry-remote seems to do the trick for me.
Two years later, byebug also has support for remote debugging. Use Byebug.start_server
and byebug -R
. See also Nicholas Gronow's example on SO: https://stackoverflow.com/a/25823241/567762
from foreman.
I have been trying out overmind and it great so far.
from foreman.
Related Issues (20)
- Odd error message when you skip the 'start' command and include a -f
- Using RuboCop?
- issue killing subprocesses using `cd` with failure at startup HOT 1
- breakpoint vscode not work to Ruby
- After the foreman finishes, the ruby process continues to exist HOT 2
- Release 1.0? HOT 1
- About link is broken HOT 1
- Foreman does not terminate child process HOT 3
- Forman doesn't show errors and logs of Procfile commands HOT 3
- Change https://ddollar.github.com/foreman to https://ddollar.github.io/foreman on repo description link
- Port 5000 taken by Mac OSX HOT 1
- When launching rails via foreman, rails asset pipeline errors
- Support for x64-mingw-ucrt platform
- Version Optimize
- Document that Foreman secretly sets the PORT environment variable to 5000 HOT 1
- Error after running command "foreman start"
- foreman export systemd raises undefined method `exists?' for File:Class (NoMethodError) HOT 1
- Security CVE-2022-3874 HOT 4
- Usage Error: Unrecognized or legacy configuration settings found
- Ruby32-x64/lib/ruby/gems/3.2.0/gems/foreman-0.87.2/lib/foreman/engine.rb:201:in `kill': Invalid argument (Errno::EINVAL)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foreman.