This article describes a really nice docker development environment for working on rails applications.
But, you still need a local ruby installation if you want to create a new rails project, and you need ruby and the dip gem installed to provision/launch/shutdown the docker environment.
This project describes a process for creating and then dockerising a new rails project without these issues.
- Docker
Build the ruby container and launch a shell:
PROJECT=foobar make create-rails-app
This will create a new rails application and "dockerise" it.
At this point, you should be able to use the docker development environment to develop your rails application.
See the makefile
for details on how to start/stop the environment, get a
shell or rails console prompt, etc.
To get hotwire working in development:
- Edit the development section of
config/cable.yml
as follows:
development:
adapter: redis
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
- Edit
app/views/layouts/application.html.erb
and add this line just before</head>
:
<%= turbo_include_tags %>
- add rspec