taupiqueur_shiny has quit [Remote host closed the connection]
some14u has quit [Ping timeout: 245 seconds]
taupiqueur_shiny has joined #ruby
konsolebox has joined #ruby
hightower2 has joined #ruby
hightower2 has quit [Ping timeout: 240 seconds]
reset has joined #ruby
m_antis has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
passbe has quit [Quit: bye...]
passbe has joined #ruby
m_antis has joined #ruby
Guest55 has joined #ruby
caedmon has joined #ruby
<Guest55>
Hi all, I'm trying to convert some ruby code from github to use "sequel" instead of "data_mapper" for a SQLite database. However as I'm not a ruby developer I'm struggling to get it working and receive an error. The original code can be found here: https://github.com/jerakia/jerakia/blob/master/lib/jerakia/scope/server.rb and the altered version of
<ruby[bot]>
Guest55: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<adam12>
Guest55: Hard to say just by looking at the code and error, but maybe its an ordering problem.
<adam12>
Guest55: IMHO, add a few "puts" statements before a few important actions. creating table, and then defining the model.
<adam12>
ie. `puts "Creating table?"` before the DB.create_table? line, and `puts "Defining model"` before the `class Resource < Sequel::Model(:resources)` line. See if they show up in order.
<adam12>
I'm assuming they should, but maybe Ruby is hoisting the class definition up higher...
sgtapple has left #ruby [#ruby]
<Guest55>
adam12: I added the puts and it seems all of them get executed and the error occurs still at the "class Resource" as before - any hint why the database might not get created even that I use ```DB.create_table?(:resources) do``` ?
<adam12>
Guest55: What happens if you remove the question mark from `create_table?`? Does it blow up?
pavelz has quit [Ping timeout: 250 seconds]
pavelz has joined #ruby
<Guest55>
adam12: If I remove the "?" it seems like the trace shows up first in the log of the container and then all DEBUG output and the Strings from "puts" are shown.
<Guest55>
The error is: /usr/lib/ruby/gems/3.2.0/gems/sqlite3-1.6.3-x86_64-linux/lib/sqlite3/database.rb:152:in `initialize': SQLite3::SQLException: no such table: resources (Sequel::DatabaseError)
<Guest55>
From the trace it's origin is " class Resource < Sequel::Model(:resources)"
shokohsc51080 has joined #ruby
shokohsc5108 has quit [Ping timeout: 250 seconds]
shokohsc51080 is now known as shokohsc5108
<adam12>
Guest55: Are you running this inside Docker?
<Guest55>
Inside podman - but basically yes
<adam12>
Can you show full trace again?
<adam12>
I was thinking maybe teh database volume is being lost but that doesn't make much sense.
<Guest55>
adam12: I just tried to alter the behavior by adding an explicit volume for the database location and it seems like the trace changed - which could inidicate that there is a permission error when creating the file?
<adam12>
Guest55: Yes, quite possibly
_ht has joined #ruby
<Guest55>
adam12: My fault - if I use the volume I now get an error, that it already exists - I'll try to add the "?" and guess it means that there is some issue with the db location within the container
<adam12>
Guest55: So it's working now?
<Guest55>
adam12: Let me rebuild the container and retest
<adam12>
Presumably you can put the `?` back on, I just wanted to see if it was hiding an error.
_ht has quit [Client Quit]
_ht has joined #ruby
<Guest55>
Yes, I added it back to the code and I'm rebuilding the container
taupiqueur_shiny has quit [Remote host closed the connection]
<adam12>
Instead of `Sequel::Model(:resources)`, what about `Sequel::Model(DB[:resources])`
<Guest55>
Yes that code created two databases - the "token.db" I was able to get working somehow....
<adam12>
Sequel::Model will use first database it sees opened by default. You need to specify the other DB when creating the model.
<adam12>
bbiaf. lunch.
<Guest55>
Okay - enjoy - thanks for the help so far!
<Guest55>
adam12: Your suggestion solved that problem - working on the next one... ;)
John_Ivan has quit [Quit: Disrupting the dragon's slumber one time too often shall eventually bestow upon all an empirical and indiscriminate conflagration that will last for all goddamn eternity.]
<adam12>
Guest55: Cheers :)
yosafbridge has quit [Ping timeout: 246 seconds]
willfish has quit [Ping timeout: 246 seconds]
yosafbridge has joined #ruby
Linux_Kerio has joined #ruby
Guest55 has quit [Quit: Client closed]
keb has joined #ruby
keb has quit [Quit: Leaving]
keb has joined #ruby
keb has quit [Client Quit]
taupiqueur_shiny has joined #ruby
Starfoxxes has quit [Ping timeout: 246 seconds]
Starfoxxes has joined #ruby
willfish has joined #ruby
willfish has quit [Ping timeout: 246 seconds]
taupiqueur_shiny has quit [Remote host closed the connection]
taupiqueur_shiny has joined #ruby
<wakaflaka>
interesting, chatgpt thinks there'd be 10% less code in the world if python was as simple as ruby
<wakaflaka>
but!
<wakaflaka>
if it was all .asm, it could be anywhere from 900% to 9900% more code in the world
<ox1eef_>
Right, but ASM looks beautiful.
<ox1eef_>
900% to 9900% more beauty.
<wakaflaka>
yeah it does in a way :D
<wakaflaka>
like two concrete columns
<wakaflaka>
representing the duality in nature, ie. the unity of man and woman
<wakaflaka>
:thinking_face:
<ox1eef_>
Thinking too much xD
willfish has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
hightower2 has joined #ruby
rvalue has joined #ruby
_ht has quit [Quit: _ht]
Linux_Kerio has quit [Ping timeout: 246 seconds]
infinityfye has quit [Quit: Leaving]
taupiqueur_shiny has quit [Remote host closed the connection]
taupiqueur_shiny has joined #ruby
willfish has quit [Ping timeout: 260 seconds]
taupiqueur_shiny has quit [Remote host closed the connection]
caedmon has quit [Ping timeout: 250 seconds]
konsolebox has quit [Ping timeout: 250 seconds]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
iodan has quit [Read error: Connection reset by peer]