-
Notifications
You must be signed in to change notification settings - Fork 22k
Closed
Description
Steps to reproduce
Create a new Rails project like this:
rails _8.0.2_ new my_website --js=esbuild --css=tailwind --database=postgresql
Run:
bin/setup
Expected behavior
The command should succeed and the server should be running, because bin/setup
runs bin/dev
.
Actual behavior
The command fails because there aren't any npm dependencies installed.
$ bin/setup
== Installing dependencies ==
The Gemfile's dependencies are satisfied
yarn install v1.22.22
info No lockfile found.
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Saved lockfile.
✨ Done in 0.03s.
== Preparing database ==
Created database 'my_website_development'
Created database 'my_website_test'
== Removing old logs and tempfiles ==
== Starting development server ==
12:23:09 web.1 | started with pid 11853
12:23:09 js.1 | started with pid 11854
12:23:09 css.1 | started with pid 11855
12:23:09 js.1 | yarn run v1.22.22
12:23:09 css.1 | yarn run v1.22.22
12:23:09 css.1 | $ npx @tailwindcss/cli -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify --watch
12:23:09 js.1 | $ esbuild app/javascript/*.* --bundle --sourcemap --format=esm --outdir=app/assets/builds --public-path=/assets --watch
12:23:09 js.1 | /bin/sh: esbuild: command not found
12:23:09 js.1 | error Command failed with exit code 127.
12:23:09 js.1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
12:23:10 js.1 | exited with code 127
12:23:10 system | sending SIGTERM to all processes
12:23:11 css.1 | exited with code 1
12:23:11 web.1 | terminated by SIGTERM
Here's the package.json
-- shouldn't tailwind and esbuild be there (edit: and hotwire dependencies)?
{
"name": "app",
"private": true,
"scripts": {
"build": "esbuild app/javascript/*.* --bundle --sourcemap --format=esm --outdir=app/assets/builds --public-path=/assets",
"build:css": "npx @tailwindcss/cli -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify"
}
}
Edit: here are some more logs -- it's running yarn add
but the dependencies aren't found in package.json
:
...
Install esbuild
run yarn add --dev esbuild from "."
Add build script
run npm pkg set scripts.build="esbuild app/javascript/*.* --bundle --sourcemap --format=esm --outdir=app/assets/builds --public-path=/assets" from "."
run yarn build from "."
run bundle install --quiet
rails turbo:install stimulus:install
apply /Users/username/.rbenv/versions/3.4.2/lib/ruby/gems/3.4.0/gems/turbo-rails-2.0.13/lib/install/turbo_with_node.rb
Import Turbo
append app/javascript/application.js
Install Turbo
run yarn add @hotwired/turbo-rails from "."
run bundle install --quiet
apply /Users/username/.rbenv/versions/3.4.2/lib/ruby/gems/3.4.0/gems/stimulus-rails-1.3.4/lib/install/stimulus_with_node.rb
Create controllers directory
create app/javascript/controllers
create app/javascript/controllers/index.js
create app/javascript/controllers/application.js
create app/javascript/controllers/hello_controller.js
Import Stimulus controllers
append app/javascript/application.js
Install Stimulus
run yarn add @hotwired/stimulus from "."
run bundle install --quiet
rails css:install:tailwind
apply /Users/username/.rbenv/versions/3.4.2/lib/ruby/gems/3.4.0/gems/cssbundling-rails-1.4.3/lib/install/tailwind/install.rb
apply /Users/username/.rbenv/versions/3.4.2/lib/ruby/gems/3.4.0/gems/cssbundling-rails-1.4.3/lib/install/install.rb
Build into app/assets/builds
exist app/assets/builds
identical app/assets/builds/.keep
unchanged .gitignore
unchanged .gitignore
Remove app/assets/stylesheets/application.css so build output can take over
remove app/assets/stylesheets/application.css
append Procfile.dev
Add bin/dev to start foreman
identical bin/dev
Install Tailwind
create app/assets/stylesheets/application.tailwind.css
run yarn add tailwindcss@latest @tailwindcss/cli@latest from "."
Add build:css script
Add build:css script
run npm pkg set scripts.build:css="npx @tailwindcss/cli -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify" from "."
run yarn build:css from "."
run bundle install --quiet
run bundle binstubs kamal
run bundle exec kamal init
Created configuration file in config/deploy.yml
Created .kamal/secrets file
Created sample hooks in .kamal/hooks
force .kamal/secrets
force config/deploy.yml
rails solid_cache:install solid_queue:install solid_cable:install
create config/cache.yml
create db/cache_schema.rb
gsub config/environments/production.rb
create config/queue.yml
create config/recurring.yml
create db/queue_schema.rb
create bin/jobs
gsub config/environments/production.rb
create db/cable_schema.rb
force config/cable.yml
System configuration
Rails version: 8.0.2
Ruby version: ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [arm64-darwin24]
(M1 MacBook)
Metadata
Metadata
Assignees
Labels
No labels