Giter Site home page Giter Site logo

Comments (13)

ndbroadbent avatar ndbroadbent commented on June 4, 2024 6

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.

shioyama avatar shioyama commented on June 4, 2024 5

For anyone wanting to use pry in foreman, pry-remote seems to do the trick for me.

from foreman.

erezny avatar erezny commented on June 4, 2024 3

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.

millisami avatar millisami commented on June 4, 2024

+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.

aaronbrethorst avatar aaronbrethorst commented on June 4, 2024

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.

adahl avatar adahl commented on June 4, 2024

Same problem as author...

from foreman.

samdalton avatar samdalton commented on June 4, 2024

I'm also having this issue when using pry's debugging.

from foreman.

leehambley avatar leehambley commented on June 4, 2024

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.

dunkstewart avatar dunkstewart commented on June 4, 2024

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.

millisami avatar millisami commented on June 4, 2024

@dunkstewart Can you post a wiki according to your setup so that it would be easy enough for others?

from foreman.

vinnividivicci avatar vinnividivicci commented on June 4, 2024

@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.

jaredbeck avatar jaredbeck commented on June 4, 2024

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.

nijeesh-rently avatar nijeesh-rently commented on June 4, 2024

I have been trying out overmind and it great so far.

from foreman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.