These are chat archives for dry-rb/chat

25th
Oct 2017
Jeff Dickey
@jdickey
Oct 25 2017 08:56

Problem with a just-generated Dry::Web::Roda app and DB-related Rake tasks (only ones I've tried so far).

First, I've gone through the instructions in the README, and get the "Welcome" screen up with no warnings/errors in Puma. Running rake -T gives me a list of 10 db-related tasks, as well as spec. OK so far.

But, running rake db:create gives me a KeyError and a stack trace:

rake aborted!
KeyError: key not found: :block
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/components/bootable.rb:311:in `fetch'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/components/bootable.rb:311:in `block'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/components/bootable.rb:273:in `lifecycle'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/components/bootable.rb:84:in `init'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/booter.rb:63:in `block (2 levels) in init'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/booter.rb:93:in `block in call'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/booter.rb:117:in `with_component'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/booter.rb:88:in `call'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/booter.rb:62:in `block in init'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/booter.rb:117:in `with_component'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/booter.rb:61:in `init'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/booter.rb:76:in `block in start'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/booter.rb:117:in `with_component'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/booter.rb:73:in `start'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/container.rb:554:in `block in load_component'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/container.rb:547:in `tap'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/container.rb:547:in `load_component'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-system-0.8.1/lib/dry/system/container.rb:480:in `resolve'
/Users/jeffdickey/src/rails/meldd/fort-roda/tmp/gemset/gems/dry-container-0.6.0/lib/dry/container/mixin.rb:125:in `[]'
/Users/jeffdickey/src/rails/meldd/fort-roda/Rakefile:19:in `settings'
/Users/jeffdickey/src/rails/meldd/fort-roda/Rakefile:24:in `database_uri'
/Users/jeffdickey/src/rails/meldd/fort-roda/Rakefile:60:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:create
(See full trace by running task with --trace)

On the one hand, I feel like I'm missing something blindingly obvious; on the other, an error reported from within Dry::Components on a virgin app gives me pause.

Any pointers?

Tim Riley
@timriley
Oct 25 2017 08:58
@jdickey I’m on my phone right now but I can promise you I’ll take a look at this first thing tomorrow (12 hours from now). Sorry you experienced an error! I can’t actually scroll the backtrace on my phone in the Gitter app (🙄) but it could perhaps be due to some gem upgrades that we need to account for in the generated app
Couple of questions off the top of my head:
  • you’ve run bin/setup I presume?
  • what version of dry-system is in the Gemfile.lock? If it’s 0.8.0, maybe try locking to an 0.7.x version and trying again?
Maybe it doesn’t like being inside a src/rails dir 😜
Jeff Dickey
@jdickey
Oct 25 2017 09:03
@timriley Thanks! Greatly appreciate any help. dry-system is 0.8.1; will try an 0.7.x and see what happens. The ~/src/rails/meldd is a historical quirk; meldd references the org I'm with now, and we originally started out as a Rails shop, hence obsolete directory -naming conventions. Thanks for the dry-system tip :D
Tim Riley
@timriley
Oct 25 2017 09:04
Cool :) I’ll look tomorrow regardless - it’s actually on my list to revisit the app generator and make some tweaks/upgrades in the next few days, so your questions here are well timed. We’re also going to begin putting together the start of some docs on the website too.
Jeff Dickey
@jdickey
Oct 25 2017 09:05
Docs would be great, of course. I'll keep an eye out here. Thanks again
Piotr Solnica
@solnic
Oct 25 2017 09:33
@timriley where are those db rake tasks? O_o
ahh I see it, we use built-in rom-sql's tasks
yeah it's outdated
still uses boot methods instead of init
Tim Riley
@timriley
Oct 25 2017 09:35
@solnic I’ll fix tomorrow :)
Piotr Solnica
@solnic
Oct 25 2017 09:35
there's more to update to make it work with dry-s 0.8
Tim Riley
@timriley
Oct 25 2017 09:35
And yeah, I’m still (slowly) working on the CLI to provide better things than these rake tasks.
Piotr Solnica
@solnic
Oct 25 2017 09:36
you need to rename rom boot file to persistence since that's the top level key
Tim Riley
@timriley
Oct 25 2017 09:36
If you have any pointers let me know @solnic and I’ll run through them tomorrow
Yeah
Piotr Solnica
@solnic
Oct 25 2017 09:36
otherwise lazy-booting won't work with it
Tim Riley
@timriley
Oct 25 2017 09:36
Yeah
Piotr Solnica
@solnic
Oct 25 2017 09:36
settings task is also not needed, it'll lazy-boot
Tim Riley
@timriley
Oct 25 2017 09:36
👍🏼
Piotr Solnica
@solnic
Oct 25 2017 09:37
@jdickey I'd suggest waiting until tomorrow so that we can get this updated to latest dry-system
Tim Riley
@timriley
Oct 25 2017 09:38
I got caught out here. In future it’d be good to coordinate dry-system breaking changes releases with higher level gems like this one.
Gustavo Caso
@GustavoCaso
Oct 25 2017 09:41
:+1: about that
Jeff Dickey
@jdickey
Oct 25 2017 10:29
@solnic, thanks. I don't expect to get much done today anyway; I'm bogged down on internal docs now
Piotr Solnica
@solnic
Oct 25 2017 11:45
@timriley sorry about that, I keep forgetting we have app generators. Would be good to create a release check-list for this kind of stuff