bullet-train-co / bullet_train

The Open Source Ruby on Rails SaaS Template
MIT License
1.67k stars 265 forks source link

Crash on initial bin/setup run - error "@isaacs/cliui#***" is wrong version, and LoadError: Could not open library 'vips.42' #1488

Open ndbroadbent opened 5 months ago

ndbroadbent commented 5 months ago

Hello, I'm trying out Bullet Train but running into a crash on the initial bin/setup run. I followed the instructions in the README and bin/configure worked well, but I get this crash on bin/setup:

❯ bin/setup
== Checking dependencies ==
Overmind not found
We recommend installing overmind to run your application processes
Visit https://github.com/DarthSim/overmind#installation for more information.
== Installing dependencies ==
The Gemfile's dependencies are satisfied
yarn check v1.22.19
warning Pattern ["strip-ansi@^6.0.1"] is trying to unpack in the same destination "/Users/ndbroadbent/Library/Caches/Yarn/v6/npm-strip-ansi-cjs-6.0.1-9e26c63d30f53443e9489495b2105d37b67a85d9-integrity/node_modules/strip-ansi-cjs" as pattern ["strip-ansi-cjs@npm:strip-ansi@^6.0.1"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["string-width@^4.1.0"] is trying to unpack in the same destination "/Users/ndbroadbent/Library/Caches/Yarn/v6/npm-string-width-cjs-4.2.3-269c7117d27b05ad2e536830a8ec895ef9c6d010-integrity/node_modules/string-width-cjs" as pattern ["string-width-cjs@npm:string-width@^4.2.0"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["strip-ansi@^6.0.0"] is trying to unpack in the same destination "/Users/ndbroadbent/Library/Caches/Yarn/v6/npm-strip-ansi-cjs-6.0.1-9e26c63d30f53443e9489495b2105d37b67a85d9-integrity/node_modules/strip-ansi-cjs" as pattern ["strip-ansi-cjs@npm:strip-ansi@^6.0.1"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["string-width@^4.2.0"] is trying to unpack in the same destination "/Users/ndbroadbent/Library/Caches/Yarn/v6/npm-string-width-cjs-4.2.3-269c7117d27b05ad2e536830a8ec895ef9c6d010-integrity/node_modules/string-width-cjs" as pattern ["string-width-cjs@npm:string-width@^4.2.0"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["wrap-ansi@^7.0.0"] is trying to unpack in the same destination "/Users/ndbroadbent/Library/Caches/Yarn/v6/npm-wrap-ansi-cjs-7.0.0-67e145cff510a6a6984bdf1152911d69d2eb9e43-integrity/node_modules/wrap-ansi-cjs" as pattern ["wrap-ansi-cjs@npm:wrap-ansi@^7.0.0"]. This could result in non-deterministic behavior, skipping.
warning Pattern ["string-width@^4.2.3"] is trying to unpack in the same destination "/Users/ndbroadbent/Library/Caches/Yarn/v6/npm-string-width-cjs-4.2.3-269c7117d27b05ad2e536830a8ec895ef9c6d010-integrity/node_modules/string-width-cjs" as pattern ["string-width-cjs@npm:string-width@^4.2.0"]. This could result in non-deterministic behavior, skipping.
error "@isaacs/cliui#string-width" is wrong version: expected "5.1.2", got "4.2.3"
error "@isaacs/cliui#strip-ansi" is wrong version: expected "7.1.0", got "6.0.1"
error "@isaacs/cliui#wrap-ansi" is wrong version: expected "8.1.0", got "7.0.0"
error "strip-ansi#ansi-regex" not installed
error "wrap-ansi#ansi-styles" not installed
error "string-width#emoji-regex" not installed
error Found 6 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.
yarn install v1.22.19
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.07s.
rake aborted!
LoadError: Could not open library 'vips.42': dlopen(vips.42, 0x0005): tried: 'vips.42' (no such file), '/System/Volumes/Preboot/Cryptexes/OSvips.42' (no such file), '/usr/lib/vips.42' (no such file, not in dyld cache), 'vips.42' (no such file). (LoadError)
Could not open library 'libvips.42.dylib': dlopen(libvips.42.dylib, 0x0005): tried: 'libvips.42.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibvips.42.dylib' (no such file), '/usr/lib/libvips.42.dylib' (no such file, not in dyld cache), 'libvips.42.dylib' (no such file).
Searched in <system library path>, /usr/lib, /usr/local/lib, /opt/local/lib, /opt/homebrew/lib
<internal:/Users/ndbroadbent/.local/share/mise/installs/ruby/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/Users/ndbroadbent/.local/share/mise/installs/ruby/3.3.1/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/Users/ndbroadbent/code/influxdb_api_connector/config/application.rb:8:in `<main>'
/Users/ndbroadbent/code/influxdb_api_connector/Rakefile:4:in `require_relative'
/Users/ndbroadbent/code/influxdb_api_connector/Rakefile:4:in `<main>'
/Users/ndbroadbent/.local/share/mise/installs/ruby/3.3.1/bin/bundle:25:in `load'
/Users/ndbroadbent/.local/share/mise/installs/ruby/3.3.1/bin/bundle:25:in `<main>'
(See full trace by running task with --trace)

== Command ["bin/link"] failed ==

I'm on a M2 MacBook Pro, and I use Mise to manage my Ruby and Node versions. I use Postgres.app to run multiple Postgres versions, so I skipped the postgres warning:

postgresql@14 is not installed via Homebrew. Try running `brew install postgresql@14`.
Try proceeding without postgresql@14? [y/n]
y

I also have a specific version of Redis installed via Homebrew (redis@6.2), so I skipped that warning as well:

redis is not installed via Homebrew. Try running `brew install redis`.
Try proceeding without redis? [y/n]
y

Otherwise everything seemed to run fine until the bin/setup step.

Thanks for your help!

ndbroadbent commented 5 months ago

I fixed the vips issue by running brew install vips. yarn check is still failing with errors but it doesn't seem to prevent the bin/setup script from continuing. Next I got up to this redis-cli crash:

Rebuilding...

Done in 461ms.
✨  Done in 11.42s.
yarn run v1.22.19
$ THEME="light" NODE_PATH=./node_modules tailwindcss -c tailwind.config.js -i ./app/assets/stylesheets/application.css -o ./app/assets/builds/application.light.css --postcss ./postcss.config.js

Rebuilding...

Done in 1102ms.
✨  Done in 3.15s.

== Preparing database ==
Created database 'influxdb_api_connector_development'
Created database 'influxdb_api_connector_test'
🌱 Generating global seeds.
🌱 Generating development environment seeds.

== Removing old logs and tempfiles ==

== Copying `config/application.yml.example` to `config/application.yml`. ==

== Checking Redis connection ==
bin/setup:71:in ``': No such file or directory - redis-cli (Errno::ENOENT)
    from bin/setup:71:in `block in <main>'
    from /Users/ndbroadbent/.local/share/mise/installs/ruby/3.3.1/lib/ruby/3.3.0/fileutils.rb:240:in `chdir'
    from /Users/ndbroadbent/.local/share/mise/installs/ruby/3.3.1/lib/ruby/3.3.0/fileutils.rb:240:in `cd'
    from bin/setup:24:in `<main>'

That was my own fault for not running brew link redis@6.2 earlier, since I hadn't needed the redis-cli command before. So I ran that.

Rebuilding...

Done in 1101ms.
✨  Done in 3.15s.

== Preparing database ==

== Removing old logs and tempfiles ==

== Copying `config/application.yml.example` to `config/application.yml`. ==
`config/application.yml` already exists!

== Checking Redis connection ==
You are connected to 1 server.

You're set! Now you can run bin/dev to boot your server and access your new application.

bin/dev works well and I can access localhost:3000. I looked through the docs, README, and bin/setup logs to find the default username/password, but I couldn't find it anywhere. It took me a while to realize that I needed to click "Don't have an account?" and create a new account from the web UI.

Anyway, I'm all set! Thanks!

jagthedrummer commented 5 months ago

I'm going to re-open this so we can make this process smoother. Thanks for the report @ndbroadbent.

adnjoo commented 1 month ago

had the same issue.

equipment:

repro steps:

  1. cloned the repo
  2. bin/setup
  3. bin/dev

expected: running

actual: crash

14:39:07 web.1              | started with pid 10309
14:39:07 worker.1           | started with pid 10310
14:39:07 js.1               | started with pid 10311
14:39:07 light-css.1        | started with pid 10312
14:39:07 light-mailer-css.1 | started with pid 10313
14:39:07 web.1              | /Users/andrewnjoo/.rvm/gems/ruby-3.2.1/gems/ffi-1.17.0-arm64-darwin/lib/ffi/dynamic_library.rb:94:in `load_library': Could not open library 'vips.42': dlopen(vips.42, 0x0005): tried: 'vips.42' (no such file), '/System/Volumes/Preboot/Cryptexes/OSvips.42' (no such file), '/usr/lib/vips.42' (no such file, not in dyld cache), 'vips.42' (no such file), '/usr/local/lib/vips.42' (no such file), '/usr/lib/vips.42' (no such file, not in dyld cache). (LoadError)
14:39:07 web.1              | Could not open library 'libvips.42.dylib': dlopen(libvips.42.dylib, 0x0005): tried: 'libvips.42.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibvips.42.dylib' (no such file), '/usr/lib/libvips.42.dylib' (no such file, not in dyld cache), 'libvips.42.dylib' (no such file), '/usr/local/lib/libvips.42.dylib' (no such file), '/usr/lib/libvips.42.dylib' (no such file, not in dyld cache).

also had to run these commands to run app

  1. bin/rails db:create
  2. bin/rails db:migrate