nickthecook / archyve

GNU Affero General Public License v3.0
120 stars 15 forks source link

Having a `yarn` problem with `ops up` #84

Closed MadBomber closed 1 month ago

MadBomber commented 1 month ago

Hello @nickthecook your archyve looks like it will be fun to play with. I'm running it under Ruby 3.3.5 on MacOS 14.6.1 I want to run everything natively on this machine with ollama . I ran into this problem: ... oh btw I'm running your ops task runner in the pure ruby form. I do have crops installed but I thought I'd look at the original version first. I did the same kind of thing for my justprep program - deployed as both a ruby gem and a crystal binary.

23:07:33 3.3.5 v20.15.0 main nibiru:archyve $ ops --version
Usage: ops [-f|--file <ops_yml>] action [<action args>
  ops_yml:      the config file to load instead of './ops.yml'
  action_args:  arguments to the action loaded from the config file; depends on the action
23:07:40 3.3.5 v20.15.0 main nibiru:archyve $ ops up
[Brew] overmind                                    OK
[Brew] poppler                                     OK
[Brew] pandoc                                      OK
[Custom] bundle config --local path vendor/bundle  OK
[Custom] bundle config set --local build.pg ${PG_OPTS} OK
[Custom] bundle                                    OK
[Custom] containers                                OK
[Custom] yarn                                      FAILED
Error meeting Custom dependency 'yarn':
<internal:/Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:141:in `require': cannot load such file -- rack/handler (LoadError)
    from <internal:/Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:141:in `rescue in require'
    from <internal:/Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:135:in `require'
    from /Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/yarn-0.1.1/lib/rack/handler/yarn.rb:3:in `<top (required)>'
    from <internal:/Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
    from <internal:/Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
    from /Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/yarn-0.1.1/lib/yarn.rb:1:in `<top (required)>'
    from <internal:/Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
    from <internal:/Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
    from /Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/yarn-0.1.1/bin/yarn:7:in `<top (required)>'
    from /Users/dewayne/.rbenv/versions/3.3.5/bin/yarn:25:in `load'
    from /Users/dewayne/.rbenv/versions/3.3.5/bin/yarn:25:in `<main>'
<internal:/Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require': cannot load such file -- rack/handler (LoadError)
    from <internal:/Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
    from /Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/yarn-0.1.1/lib/rack/handler/yarn.rb:3:in `<top (required)>'
    from <internal:/Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
    from <internal:/Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
    from /Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/yarn-0.1.1/lib/yarn.rb:1:in `<top (required)>'
    from <internal:/Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
    from <internal:/Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
    from /Users/dewayne/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/yarn-0.1.1/bin/yarn:7:in `<top (required)>'
    from /Users/dewayne/.rbenv/versions/3.3.5/bin/yarn:25:in `load'
    from /Users/dewayne/.rbenv/versions/3.3.5/bin/yarn:25:in `<main>'
[Gem] rerun                                        OK
23:07:54 3.3.5 v20.15.0 main nibiru:archyve $
MadBomber commented 1 month ago

... so I just ignored the problem with yarn and kept going through the ops sequence. The final ops server looks like it started up everything just find but after starting redis and sidekiq it freaks out because it can't find tailwind-highlightjs

css     | Error: Cannot find module 'tailwind-highlightjs'
css     | Require stack:
css     | - /Users/dewayne/sandbox/git_repos/madbomber/archyve/config/tailwind.config.js
css     |     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
css     |     at Function._resolveFilename (pkg/prelude/bootstrap.js:1951:46)
css     |     at Function.resolve (node:internal/modules/cjs/helpers:108:19)
css     |     at Function.resolve (/snapshot/tailwindcss/standalone-cli/patch-require.js:34:38)
css     |     at _resolve (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:251148)
css     |     at jiti (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:253746)
css     |     at /Users/dewayne/sandbox/git_repos/madbomber/archyve/config/tailwind.config.js:94:5
css     |     at evalModule (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:256443)
css     |     at jiti (/snapshot/tailwindcss/node_modules/jiti/dist/jiti.js:1:254371)
css     |     at /snapshot/tailwindcss/lib/lib/load-config.js:56:30 {
css     |   code: 'MODULE_NOT_FOUND',
css     |   requireStack: [
css     |     '/Users/dewayne/sandbox/git_repos/madbomber/archyve/config/tailwind.config.js'
css     |   ]
css     | }
MadBomber commented 1 month ago

... and then when I go to localhost:3300 An exception is generated about not being able to find the tailwind asset.


Sprockets::Rails::Helper::AssetNotFound in Devise::Sessions#new

Showing /Users/dewayne/sandbox/git_repos/madbomber/archyve/app/views/layouts/application.html.erb where line #8 raised:

The asset "tailwind.css" is not present in the asset pipeline.

I'm a back-end AI software engineering kind of dev who leaves this front-end UI stuff to the artists while I diddle with the business logic, database and the LLMs.

nickthecook commented 1 month ago

Hey @MadBomber, glad to hear you're running natively and are trying out ops!

I haven't done much with the Ruby ops in a while. I do recommend using crops, but if the old, Ruby version works then great.

As to the yarn issue, based on your logs I'm guessing you have the yarn gem installed instead of the npm package yarn. If you run which yarn it will probably point to the gem bin.

If you're not actually using the yarn gem, you could uninstall it, or you could modify your $PATH so it finds the yarn you need for Archyve instead.

lmk how that goes!

MadBomber commented 1 month ago

yes, I was running the old yarn gem. I uninstalled it, cleaned up my system then did a brew install yarn I also uninstall the ops_team gem so that the crops version of the executable would work. BTW in my justprep gem/crystal version I have a common directory which is shared between the Ruby gem and the Crystal binary. In that common directory the files are named *.crb meaning that they can be used with either Ruby or Crystal. I also have a file in the Ruby gem side that aliases many of the Ruby method names to the pluralized versions that Crystal uses. That way I do things like "file.exist? and file.exists?" and each version is okay with it.

I ran through the ops sequence to get stuff running; got the login page and signed in.

Cool Logo.

We can close this issue.

nickthecook commented 1 month ago

Nice, I might look into the crb thing, thanks for the tip.

Glad you got the app started.