I created a new app in a devcontainer using rails-new -u 3.3.5 -r 8.0.1 dummy2_project --devcontainer --css bootstrap followed by cd dummy2_project and code . Then I started up the devcontainer, ran bin/setup then bin/dev. Which failed due to
09:07:03 css.1 | started with pid 26275
09:07:03 css.1 | yarn run v1.22.22
09:07:03 css.1 | error Command “build:css” not found.
Which then causes bin/dev to abort.
The Procfile has this line yarn build:css which has no matching entry in package.json, which is why it failed
I can run bin/rails s, and get the basic Rails page up. But when I add a home page and set the root to be the home page then I get an error.
Showing /workspaces/dummy2_project/app/views/layouts/application.html.erb where line #23 raised:
The asset 'application.css' was not found in the load path.
Now there are at least two parts to the problem.
I need to find out what have to add to the configuration to get `yarn build:css’ working.
I need to find out how to amend the setup for --css bootstrap so that it just works without spending hours on Stackoverflow, discuss.rubyonrails.org & so on.
This error breaks the “Rails way”, which is that setting up a new app should be quick and painless. I’m guessing this hasn’t had much testing.
Once I find a solution, I’ll look at modifying the setup code so that others won’t have this problem in future.
If you’re using rails-new, check the documentation or source of this command. It is not part of the standard Rails toolchain and might be provided by a specific package, script, or internal tooling in your environment.
rails new is the official Rails command, and its behavior is documented in Rails guides.