Running Rack in debug mode on Mac

It’s been a while since I tried to run in debug mode. Now I can’t figure out how.

I can run Rack and point it at my development directory:

/Applications/ -u /my/user/dir

That works just fine. Rack finds and loads my plugin.

When I add the -d flag…

/Applications/ -d -u /my/user/dir

… Rack complains on startup that “Rack’s resource directory “./res” does not exist.” It appears that with the -d flag, Rack uses the current working directory as its system directory by default.

When I try to specify a system directory…

/Applications/ -d -u /my/usr/dir -s /Applications/

… Rack launches, complains about a JSON parsing error in some unspecified stream, and loads only Rack’s 11 core plugins.

The last time I successfully ran debug mode (more than a month ago), I was using a special development version of Rack that was released alongside the SDK. I think that worked just fine (though it, too, complained of a JSON parsing error).

Is it possible to run the released version of Rack in debug mode? If so, what am I doing wrong?

1 Like

I finally got around to answering my own question here.

It turns out there is no debug mode. The -d flag enables dev mode, not debug mode. I don’t know exactly what dev mode is, but in dev mode Rack configures itself slightly differently. For example, it loads plugins from the plugins directory and not the plugins-v1 directory. And that’s why Rack didn’t find my plugins, which I’d installed in a plugins-v1 directory in my staging area.

It also turns out there is no need for debug mode. I thought the -d flag enabled the DEBUG macro. Nope DEBUG is always on, even in the released version of Rack.

And now I know.

1 Like

make debug not work on mac?

1 Like

I don’t build Rack. I build my plugin against the SDK, which has no debug make target. And I test my plugin in the official, downloaded Rack, which has no Makefile.

The manual doesn’t mention that in development mode Rack looks for plugins in the plugins dir, not the plugins-v1 dir.

That omission left me confused. Not knowing that -d makes Rack look in a different place for plugins, I kept installing my plugin in the same place, plugins-v1. That worked just fine if I omitted the -d flag, and failed if I added it.

1 Like