havenwood changed the topic of #ruby to: Ruby 3.2.2, 3.1.4, 3.3.0-preview1: https://www.ruby-lang.org | Rules: https://ruby-community.com | Logs: https://libera.irclog.whitequark.org/ruby
hightower4 has joined #ruby
hightower3 has quit [Ping timeout: 252 seconds]
szkl has quit [Quit: Connection closed for inactivity]
caedmon has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
finsternis has quit [Read error: Connection reset by peer]
caedmon has quit [Ping timeout: 248 seconds]
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
victori has joined #ruby
caedmon has joined #ruby
caedmon has quit [Ping timeout: 250 seconds]
caedmon has joined #ruby
Linux_Kerio has joined #ruby
caedmon has quit [Ping timeout: 246 seconds]
shokohsc51087 has joined #ruby
shokohsc5108 has quit [Ping timeout: 245 seconds]
shokohsc51087 is now known as shokohsc5108
_ht has joined #ruby
Linux_Kerio has quit [Ping timeout: 245 seconds]
dsdxtech has joined #ruby
dsdxtech has quit [Remote host closed the connection]
fercell has quit [Ping timeout: 246 seconds]
dviola has quit [Quit: WeeChat 4.0.3]
_ht has quit [Quit: _ht]
Linux_Kerio has joined #ruby
grenierm has joined #ruby
dviola has joined #ruby
joto has quit [Read error: Connection reset by peer]
Linux_Kerio has quit [Ping timeout: 246 seconds]
joto has joined #ruby
dviola has quit [Quit: WeeChat 4.0.3]
taupiqueur_shiny has joined #ruby
fercell has joined #ruby
dviola has joined #ruby
willfish has joined #ruby
grenierm has quit [Quit: Client closed]
teclator has joined #ruby
crespire1 has quit [Ping timeout: 258 seconds]
crespire has joined #ruby
wnd-conn is now known as wnd
lena64t has joined #ruby
lena64t1 has joined #ruby
lena64t has quit [Ping timeout: 246 seconds]
infinityfye has joined #ruby
taupiqueur_shiny has quit [Remote host closed the connection]
taupiqueur_shiny has joined #ruby
lena64t has joined #ruby
lena64t1 has quit [Ping timeout: 246 seconds]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
teclator has joined #ruby
teclator has quit [Remote host closed the connection]
teclator has joined #ruby
lena64t1 has joined #ruby
lena64t has quit [Ping timeout: 246 seconds]
lena64t has joined #ruby
lena64t1 has quit [Ping timeout: 246 seconds]
taupiqueur_shiny has quit [Remote host closed the connection]
taupiqueur_shiny has joined #ruby
lena64t has quit [Remote host closed the connection]
lena64t has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
hightower2 has joined #ruby
hightower4 has quit [Ping timeout: 244 seconds]
taupiqueur_shiny has quit [Remote host closed the connection]
taupiqueur_shiny has joined #ruby
hightower2 has quit [Ping timeout: 246 seconds]
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
ccapndave has joined #ruby
ccapndave has quit [Quit: Textual IRC Client: www.textualapp.com]
lena64t has quit [Remote host closed the connection]
lena64t has joined #ruby
brw has quit [Quit: The Lounge - https://thelounge.chat]
brw has joined #ruby
Cork has quit [Quit: .]
Cork has joined #ruby
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
<Guest55> the code and the error can be found here: https://pastebin.com/QYtyXrQ5
<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.
<Guest55> As you can see in the error I tried to change https://github.com/jerakia/jerakia/blob/master/lib/jerakia/server/rest.rb as it uses a require - I altered it to require_relative and the tried to execute a "Jerakia::Scope::Server::Database.intialize_database()" in the initalizer
<Guest55> adam12: Thanks- I will try
<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]
<Guest55> adam12: Nope, it's not working: https://pastebin.com/vFNwhReN
<ruby[bot]> Guest55: as I told you already, please use https://gist.github.com
<adam12> OOoh. You have two databases.
<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]
Bish has quit [Ping timeout: 245 seconds]
gr33n7007h has quit [Ping timeout: 246 seconds]
gr33n7007h has joined #ruby
Bish has joined #ruby