1) Minimal stake-in-the-Internet landing page. ("I'm writing a book on ActiveRecord optimization. I've worked for 3 years on AR optimization. For more details, [ ].")
2) ~3 blog posts about the topic at issue which each mention the forthcoming book and link to your landing page. Promote blog posts in the usual ways: tweet about them, send cold emails to folks whose audiences they are relevant to, post them in your usual community watering holes.
Checkpoint: if the blog posts go nowhere, don't write your book.
3) Write a minimalistic email drip campaign to send to folks who are on your list. Consider cross posting versions of the messages in it to your blog, depending on your appetite for doing this.
4) Write a proper landing page for your book.
5) Write your book.
6) Run a "launch sequence" for your book over 2~3 weeks prior to publishing your book.
7) Launch your book.
8) Get more serious about turning your book into a business via e.g. increasing acquisition, tuning the automated bookseller that is your email list, etc.
I've seen folks be really, really successful at this model on the strength of first books supported by hundreds of email subscribers and 3~5 blog posts. You do not need to be "Internet famous" to pull this off. (Anecdotally, most of my Internet buddies who do the meat-and-potatoes work here get $10k to $20k on the first book launch.)