Hello world! - How I get up and running with rails
20 APR. 2026, LUCA BULLETTI
RAILS DOCKER ACTION_TEXT
For my first trick, I'll share the setup / stack I used to create this website. Consider this a quickstart guide to my preferred rails setup for prototypes and mockups, as well as a my top candidate for the simplest rich text editor setup.
To minimize setup time on any project, I like to develop inside of docker containers. Gone are the days of old dependencies lying around forever. The less I have installed on my OS, the better.
Dependencies
- docker
Since I'm mostly using macOS and like the UI, I usually install it with the accompanying Docker Desktop app. For more specific linux setups, the docker engine install guide should be the only resource you need to follow.
- ruby
As a creature of habit, I have ruby installed via rbenv through homebrew. It is simple enough that I haven't had to tinker with it in months, but I've heard great things about mise and see that it is the install tool used in the devcontainer/ruby/*Dockerfiles. Next, we'll need to install the rails gem to have access to the rails new command.
NOTE: If you don't want ruby installed on your machine, you can follow the guide in the official rails-new repo and let docker handle everything.
Generator magic
My go-to rails new command includes 3 parameters:
rails new my_app -d postgresql -c tailwind --devcontainer
-d postgresto use postgres as a database, my preferred SQL behemoth-c tailwindto install and prepare tailwind-css, a design system that has completely replaced all other UI frameworks / libraries for me--devcontainerto get it all running on docker
For applications that don't need a database, like an SPA hooked up to an external API, I use the following:
rails new my_app -O --skip-jbuilder --skip-action-mailer --skip-action-mailbox
-Oto skip 3 gems at once, equivalent to using--skip-active-record,--skip-active-joband—-skip-active-storage.--skip-jbuilderto skip generatingjsonformat views--skip-action-mailerand--skip-action-mailboxto skip mailing related activites.
If you need to activate those frameworks at any later point, you can toggle them on or off in the config/application.rb file.
HINT: I encourage you to run rails new --help for a more detailed overview of all options, there's a ton of possible configurations.VSCode
Now that the new project is generated, let's start hacking. My editor of choice with out-of-the-box devcontainer support is VSCode. When first opening the project, it should prompt to open the project inside a devcontainer. If not, you'll find the option using the command pallette [⇧] + [⌘] + [P]. The first build can take a minute or two, but any subsequent starting / attaching to the devcontainer will be much faster. If you've installed the Docker Desktop app, you can check out the various container it created in the UI.
If you've already got some VSCode extensions you can't live without, you can add them to the .devcontainer/devcontainer.json to have them built in. Alternatively, you can do that via the VSCode UI under the extensions menu [⇧] + [⌘] + [X]. Here are my current extensions:
// .devcontainer/devcontainer.json
{
// ...
"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.vscode-containers",
"github.vscode-github-actions",
"Shopify.ruby-lsp",
"marcoroth.herb-lsp"
"KoichiSasada.vscode-rdbg",
"aki77.rails-routes",
"bradlc.vscode-tailwindcss",
]
}
}
}
// end of file
Here are links to all of those:
From here on, the world is your oyster - You now have a customized rails dev setup running in minutes wherever you have docker installed.
Rich text done right
To make the blogposts I write more interesting to look at, I use a rich text editor. The rails action_text package uses trix out of the box, which works just fine. But since this is a dev blog, I need it to support syntax highlighting for <code></code> blocks. Luckily, 37signals and the open source community have been working on one for quite a while, and Lexxy is now in beta. The install guide is straight forward and the future development plans look very promising. My favourite feature is the markdown support, which lets me copy paste long formatted texts (like this article for example) from my Markdown editor of choice (Obsidian, or VSCode with the preview feature [⇧] + [⌘] + [V]).