havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.2.1, 3.1.3, 3.0.5, 2.7.7: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://t.ly/9ua4 | Logs: https://libera.irclog.whitequark.org/ruby/
<havenwood> React Native, Flutter, or iOS + Android native are all reasonable mobile options these days.
<havenwood> React is a fine frontend framework to pair with Rails. I'd suggest considering Turbo and minimal JS as an alternative unless you really have SPA components.
<havenwood> I'd personally lean towards Flutter with ActionCable and Turbo minimizing JavaScript as much as possible.
<havenwood> Was going to suggest #rubyonrails, but just now saw there's a thread there too.
teclator has quit [Ping timeout: 248 seconds]
<havenwood> Just for future reference, please note in each channel where you're crossposting if you crosspost.
<ox1eef_> sphex: It was suggested a long time ago on the ruby bug tracker, around the era when CoffeeScript was popular and had a similar feature. Ultimately it didn't find approval.
<ox1eef_> At my job we use React, & GraphQL. Job prior to that used Vue. I think I prefer React. Rails seems to be moving away from that configuration, and I haven't tried the alternative they propose.
<adam12> Unpoly & Stimulus FTW :)
<ox1eef_> I don't mind a React-driven view layer because I use that on one of my static websites, and when I write Chrome extensions but I think it doesn't quite fit for Rails since it replaces a large part of ActionView.
<apteryx> adam12: actually, 'bundle check' says concurrent-ruby is missing, and 'bundle install' fails but lists 'rails!' as one of the dependencies it'd pull
<adam12> apteryx: Hmm. I suspect you're not able to get dependencies to install. The rails! one is suspect because I thought it was only for gems from git.
<adam12> apteryx: Share Gemfile and Gemfile.lock in a Gist
<apteryx> it's a checkout of rails from git, at 7.0.4.2
<apteryx> and I 'cd' to railties before attempting to 'gem build', 'rake test' and 'gem install' as is custom in guix
<apteryx> I'm using Guix System, and I think bundler is a bit silly, it seems it wants to install to the ruby GEM_PATH prefix, which is on a read-only file system
<apteryx> can I make it like pip and have it install its things to ~/.local/share or another user-controlled location?
<adam12> bundle install --path=X
<apteryx> OK! I'll try this.
<FullMetalStacker> @havenwood @ox1eef_ @adam12 thanks for your input! havenwood #crosspost: understood. is there some specific format for announcing that or how do you do it?
<adam12> It will probably compain about --path being deprecated. You can look up the new format but I don't know it off the top of my head.
<apteryx> it failed trying to build curses
entropie has quit [Read error: Connection reset by peer]
entropie has joined #ruby
<apteryx> seems I need to hunt all the headers, now it's redis
<apteryx> err, hiredis
<apteryx> hm. proceeded to libxml-ruby (and failed building its native extension)
<apteryx> it's a bit difficult to use bundler for native extensions on a non-FHS system it seems :-)
Linux_Kerio has quit [Ping timeout: 248 seconds]
<apteryx> ah, I had forgotten that guix shell has a '--emulate-fhs' mode now, that'll probably help
<adam12> apteryx: Fun.
nirvdrum has quit [Remote host closed the connection]
nirvdrum has joined #ruby
<ox1eef_> guix looks interesting
<apteryx> hm, I'm not done yet though: gems/mysql2-25c42c712118/ext/mysql2/conftest.c:17: undefined reference to `rb_enc_interned_str'
<apteryx> is this symbol supposed to be provided by the ruby 2.7.4 I'm using?
<apteryx> resolved by adding 'mysql' to the mix
markong has quit [Ping timeout: 248 seconds]
<apteryx> for the record, this is what worked to get a bundler environment for railties with guix: guix shell -CFND ruby-railties git make pkg-config ncurses hiredis libxml2 openssl mysql postgresql sqlite gcc-toolchain -- sh -c 'cd railties && bundle install --path=$PWD/bundler'
<adam12> apteryx: Good to know
<adam12> Don't run into too many people using guix.
eddof13 has joined #ruby
<apteryx> eh! :-)
<apteryx> I still don't quite get if this bundler environment is enough to run 'rake test'
<apteryx> am I supposed to run 'bundle exec rake test' after the successful 'bundle install'?
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FullMetalStacker has quit [Remote host closed the connection]
razetime has joined #ruby
Sankalp has quit [Ping timeout: 276 seconds]
Sankalp- has joined #ruby
Sankalp- is now known as Sankalp
grenierm has joined #ruby
wk has quit [Ping timeout: 248 seconds]
MalusVulgaris has joined #ruby
moldorcoder7 has quit [Ping timeout: 248 seconds]
wk has joined #ruby
<ox1eef_> The short story: 'bundle exec rake' will execute rake within the bundler sandbox, and expect rake to be in the Gemfile. A file that requires "bundler/setup" will activate the bundler sandbox past that point, and not neccessarily require 'rake' or whatever else is executing the file to be in the Gemfile.
razetime has quit [Ping timeout: 248 seconds]
wk has quit [Ping timeout: 248 seconds]
desnudopenguino has quit [Ping timeout: 252 seconds]
ur5us_ has quit [Ping timeout: 255 seconds]
<apteryx> thanks! I wonder what magic 'bundle' does more than adding all the Ruby libraries on GEM_PATH do. I've seen test suite misbehaving unless the gems are "activated" by bundle; what does such activation consists in, exactly?
<ox1eef_> I don't know, but I can observe a couple of things: $LOAD_PATH.size goes from 8 to 79 after require "bundler/setup", and the "require" method reverts to Ruby's implementation rather than rubygem's implementation after the require of "bundler/setup".
razetime has joined #ruby
wk has joined #ruby
desnudopenguino has joined #ruby
desnudopenguino has quit [Ping timeout: 248 seconds]
sympt5 has joined #ruby
sympt has quit [Ping timeout: 255 seconds]
sympt5 is now known as sympt
sickdyd has joined #ruby
AlexBrow1Sobinec has joined #ruby
<AlexBrow1Sobinec> Ok
ur5us_ has joined #ruby
<AlexBrow1Sobinec> exit
<AlexBrow1Sobinec> Oops
<AlexBrow1Sobinec> Lmao
AlexBrow1Sobinec has quit [Quit: leaving]
dmn has joined #ruby
wk has quit [Ping timeout: 255 seconds]
sympt has quit [Ping timeout: 276 seconds]
Linux_Kerio has joined #ruby
razetime has quit [Quit: See You Space Cowboy]
ur5us_ has quit [Ping timeout: 260 seconds]
teclator has joined #ruby
desnudopenguino has joined #ruby
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 255 seconds]
desnudopenguino has joined #ruby
desnudopenguino1 has quit [Ping timeout: 276 seconds]
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
ur5us_ has joined #ruby
crespire has quit [Ping timeout: 248 seconds]
crespire has joined #ruby
matoro has quit [Remote host closed the connection]
matoro has joined #ruby
weaksauce has joined #ruby
ur5us_ has quit [Ping timeout: 260 seconds]
weaksauc_ has quit [Ping timeout: 246 seconds]
John_Ivan_ has joined #ruby
John_Ivan has quit [Ping timeout: 276 seconds]
_ht has joined #ruby
desnudopenguino has quit [Remote host closed the connection]
desnudopenguino has joined #ruby
sickdyd has quit [Quit: leaving]
mexen has joined #ruby
siery has quit [Ping timeout: 276 seconds]
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
<rapha> hmm, can someone fathom how to get the progress bar example at https://ruby-doc.org/stdlib-3.0.0/libdoc/open-uri/rdoc/OpenURI/OpenRead.html to work? i keep getting 'wrong number of arguments (given 2, expected 0)' for it.
<rapha> (using URI.open instead of just open, which would be Kernel#open, which doesn't know about URIs)
<ox1eef_> The module is OpenURI, not just URI.
<ox1eef_> irb(main):005:0> require "open-uri"
<ox1eef_> => true
<ox1eef_> irb(main):006:0> OpenURI == URI
<ox1eef_> => false
<ox1eef_> irb(main):007:0> OpenURI.method(:open) == URI.method(:open)
<ox1eef_> => false
<ox1eef_> irb(main):008:0>
<ox1eef_>
John_Ivan__ has joined #ruby
John_Ivan_ has quit [Read error: Connection reset by peer]
wk has joined #ruby
wk has quit [Ping timeout: 268 seconds]
vinay[m] has quit [Quit: You have been kicked for being idle]
quazimodo has quit [Ping timeout: 248 seconds]
quazimodo has joined #ruby
wand has quit [Ping timeout: 255 seconds]
MalusVulgaris has quit [Ping timeout: 255 seconds]
<rapha> oh and i'd been trying OpenURI::OpenRead.open (which is private) ... but not OpenURI.open ... thank you, ox1eef_
<rapha> also, why is the OpenRead documentation formatted so differently (not to say broken) from everything else on rubyapi.org
<ox1eef_> Official docs: https://docs.ruby-lang.org/en/
<ox1eef_> ruby-doc.org is a community effort, and it uses a different rdoc theme.
<rapha> official, yes, but rubyapi.org is really nice
<rapha> also a community effort btw
silico40 has joined #ruby
<ox1eef_> Nice indeed. docs.ruby-lang.org should use that.
chirpi42 has joined #ruby
<rapha> has a lot of contributors ... one might wonder if some of them are not involved in both
silico40 has quit [Ping timeout: 248 seconds]
MalusVulgaris has joined #ruby
<ox1eef_> I hope that one day it might become what the official documentation site uses.
grenierm has quit [Quit: Client closed]
chirpi42 has quit [Quit: Best CPUs can count to infinity twice without being bugged out by zero division errors or whatnot.]
helge has joined #ruby
dionysus69 has joined #ruby
markong has joined #ruby
moldorcoder7 has joined #ruby
FullMetalStacker has joined #ruby
dmn has quit [Quit: Client closed]
nickjj_ is now known as nickjj
dmn has joined #ruby
FullMetalStacker has quit [Remote host closed the connection]
<apteryx> ox1eef_: thanks for the hints about some of the things bundle cause (w.r.t. activating gems)
smp has quit [Ping timeout: 246 seconds]
m_antis has quit [Quit: ZNC - https://znc.in]
smp has joined #ruby
m_antis has joined #ruby
wk has joined #ruby
<ox1eef_> No worries :)
wk has quit [Ping timeout: 248 seconds]
markong has quit [Ping timeout: 276 seconds]
quazimodo has quit [Ping timeout: 276 seconds]
moldorcoder7 has quit [Ping timeout: 255 seconds]
ccapndave has joined #ruby
ccapndave has quit [Quit: Textual IRC Client: www.textualapp.com]
wk has joined #ruby
markong has joined #ruby
eddof13 has joined #ruby
ule has quit [Changing host]
ule has joined #ruby
razetime has joined #ruby
razetime has quit [Client Quit]
resili46 has joined #ruby
gr33n7007h has quit [Ping timeout: 255 seconds]
gr33n7007h has joined #ruby
stirl has joined #ruby
gr33n7007h has quit [Ping timeout: 276 seconds]
gr33n7007h has joined #ruby
Pixi` has quit [Quit: Leaving]
dviola has joined #ruby
Pixi has joined #ruby
dmn has quit [Quit: Client closed]
resili46 has quit [Ping timeout: 268 seconds]
dionysus69 has quit [Ping timeout: 255 seconds]
teclator has quit [Ping timeout: 255 seconds]
citron64 has joined #ruby
citron64 has quit [Remote host closed the connection]
MalusVulgaris has quit [Quit: MalusVulgaris]
moldorcoder7 has joined #ruby
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
havenwood has quit [Client Quit]
havenwood has joined #ruby
thomas25 has joined #ruby
stirl has left #ruby [#ruby]
stirl has joined #ruby
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
moldorcoder7 has quit [Ping timeout: 255 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
markong has quit [Ping timeout: 246 seconds]
<apteryx> should I use https://github.com/ruby/timeout with Ruby 2.7.4?
<adam12> apteryx: Prefer socket timeout functionality where possible.
<adam12> Since Timeout.timeout can be unsafe.
<apteryx> OK
eddof13 has joined #ruby
r3m has quit [Quit: WeeChat 3.9-dev]
<ox1eef_> io.wait_readable(x) | io.wait_readable(x) or the slightly more tricky 'IO.select'.
<ox1eef_> woops - io.wait_writable(x) *
r3m has joined #ruby
desnudopenguino1 has joined #ruby
ur5us_ has joined #ruby
desnudopenguino has quit [Ping timeout: 255 seconds]
desnudopenguino1 is now known as desnudopenguino
defectiverobot has joined #ruby
defectiverobot has quit [Remote host closed the connection]
defectiverobot has joined #ruby
defectiverobot has quit [Ping timeout: 276 seconds]
defectiverobot has joined #ruby
dmn has joined #ruby
Vonter has quit [Ping timeout: 248 seconds]
FullMetalStacker has joined #ruby
<FullMetalStacker> #performance: I get these results:
<FullMetalStacker> completed after 805ms for this: n.to_s.chars.sum(&:to_i)
<FullMetalStacker> timeout at 12 seconds for this: n.digits.sum
<FullMetalStacker> how is this explainable?
<FullMetalStacker> (for test numbers e.g.:
<FullMetalStacker> 41072209197709380963775246024434395305601663830581040334850905244228693744382596347419007821982317576840927850749452564491648666219762075879055918471699993205339456321299184520635303537867674501328191057401776977192602115490501503368708881925317777688501999639667036942094619448801702862801996206856510691567120540750219896401541627025433629697078746175460443754922251784160783557796844623908793047754623213466021686498865128789
<FullMetalStacker> 46569313887871225517067197183238153084474061156043716634801838692177506696123096041717345676491960259100501121423288237344922065174487217040176643696458647476722261654709311979108421964737811314719210113249639246255573976838741779005066685798892015745917183474609359576564764538017856356273085626126630998491681256894566029413333282744580884314953793396835835036849639005671347754045852382363197943442730086829387997983842178332
<FullMetalStacker> 67985349759347322452284455408589594757035598066140099076766147752697894759146967984605308215093273920834881383672530318276903761558980796601112932694591277502245692163209807814706984281360233147469772509261083398795495859412058675596545381914396453358160253316806431464357017240017389146492908368134319318407562658067682632573631576607092633918992531797915939524403655679876948433438839569805554836415793045656308949708576068796
<FullMetalStacker> 30506128776042886660463411146346065868339432364217761202209577099629817334222952309262820011442857269026635399594576745955348490397587156766658502865486920006270708280623289919002877245914566448225092012859936862628505699017713414819735903964524604892089487089095832900573396517456554570883337260697956886774351493658345686610780980011202505916946886871382278496019783598217094623402106346499775313126458097229684857593399912239
<FullMetalStacker> 84948221601026227204032193380745429845319539345251602549185147993529363549809055633173568840256371641033970215501729231850314700610472314260668113508033318937858860663526850052747057913638200812894651863554569502200315114516134444493306361479133617008731392405733762761723885847580715012486786811634758227071274333346716991617854326337274275842312267533935209216413710914904232888674097285053786596249954927107566088417644258277
defectiverobot has quit [Ping timeout: 276 seconds]
<FullMetalStacker> 82472986246302555956277633608696224439801617387537833747394927024506592952346702931015976036798433917774866765607058769837887185051525784511956841601842309627488152209946480855417968540615199202607193652260117114600703498579269865393441205008783122110588228932510174391699088873258955795203433657212401348161034036866046554959815078751362730522266811743749890054544141439467988503361068942127612254420408700962527948264619377081
<FullMetalStacker> 37756121573036951409663077808237449625701614600108870543591594126702547817234880979634526219514365832796660121050990426724692713652761815330743329149243357930816398935461723545278332404854964508922601453051711432945634571509544039498741299902899507431569791854202392093155506282873949389571860052587378848533016054763825668680463386824343587516044268825282183709687970527175656439422779102500271742814525369818548468919362088752
<FullMetalStacker> 27544848599951155509130308498750312679026489416589564769800662285366275793023725769164627824020898519781876053655477684214182865176630882426629809435066200742924520946979845368212425939804220178845190890366596713494319897061938169691896331109433309251476556989985724764602097720601510938228318840349984161635173170208786580766983509427560674095175827453364478995970765599578593764559763963275006369410234425627087036786738384352
<FullMetalStacker> 58642494299423186940071222077133153317902201306920140775627863863365806375181017564791010151338337122970879688611933211711890151665709692556985831539113374517039625696101180977356618855189876247309301262705172141403894382625210005725626367215203797734192653965916137370308880692376924795028010901626149994226853729267694075403447766148221986386782969503161069838049794521272794342612765854019120466086224296528873412627307222284
<FullMetalStacker> 07756215328904203620411375414388191892215288621085678703520377174059639088577107479656251332580616839736023660834170627668564627802839084727137704136427944901932801258502329427127855766101304502176920228952740196036974461896515256979123677439694021697062851558981113301334529909167945517913162606503906918019105990563746932680692329608291059378729793540534221253624919005613878340746990452869573656987232857884901963367819746491
<FullMetalStacker> 22183023625388009519730846951004870769758767187717619846194162558939412044025664158100363385876423933330570958377241971495637840505051617580123490983020281089761538466418102453152067243628651334872777203450341687012039415265112366824934026163996512188034699663227355236450856037446717162047329299283344080963547810783425926007997232914885311237857941725657753849118638325455094591875998025692165863549502380761690785715688468912
<FullMetalStacker> 32501753100254416967191256263093943291939395560207220878839034175444131492417268481486332854261664986062857329098712120077695735190801556064049936228531339451253138870358871496363348107099889385629502842328641756500256459200490064155412219027387832727888525821267868299879295651976248885745863694027343188396090904508583494671565342953354550310142143299636300092127164556025058109187728422414110198393818938707336547297363247906
<FullMetalStacker> 67011021002172555551061606166280463584755437927746248781336603168795111428382596123432509213197757218707406044761099407845026812998139027221648199245358045875698462066937928731343782190007849487757942460957957479647409798929373232346028404311036979293880124691771356823843753906471996534287756880148588582212691859521199438530579182103203323545897472980541747334278959508838136576153780574589998427096582021225526152039987454937
<FullMetalStacker> 91055538767149983947248691790399457478999784123914059157266695612937833895762318921030518119626873857266409535329202271128437852628361837075529563165368989467110528176138181094232597980429062994833692507491016820840266573673438403033850161613595365863758496373651941798535942368080229415074023848772043467161407065211175543313639784366317056930658926841671100500696550518738833738852812934081503331376840991138290500115814848164
<FullMetalStacker> 89696507342629777075227973458794324428178561050703382133489951805786193670244248202968717902389148868503186752881318939078935173517189920741153742066154873707274376735057315638177944002072031288338267706926929761453325332413313787654920900032545310435084126128195545481479058123044397935577247203606865337021908477334415022307080522168888709402816378666268461827215414009455729391775055138471180095856622463797718706518372967108
<FullMetalStacker> 70516375419604857467040106801837342021536844929500364796346128521569090141634009588904292431108858490497367546621269762338493581195320399126353473421367840598353624759949773252502768558643802154443028446279214065589115520030721015885848675351543998516633344712002494012511315977127686397622702101489402367190292765250800530857439351890032220063960494416555017183084211198637643494638360685385135032444292174204323127878960466710
<FullMetalStacker> 28637599380002381329521974495366615447782262990506060070762192393138374738623273561152928418297715548850816109504826212488889762649896070025620069813351452614961629696531781197065123960076512583177046300036484176635892470414413785234466248001807586954250180629088008232732831010265576181585364506761405780500152339820018031563299496681064412675355646276626196053276066808710101354076453467678709511047947949698500870517967182439
<FullMetalStacker> 88919596730582179122638750677352613980731973074158648514623435656708590545121776418198611595864161906558562221340300761359306615488105521147343236559763264415751755992624394252373092421090910774996101449429429940968078966170991803230825599627482675427650773891289975662635475421238210308814958495009398086844806486985099090924761463619044254851099654637626983040080168537820845455796997800639211850314169374818474150725629438873
<FullMetalStacker> 18324139720643107249812440760410874443848385273383223668595409204619856926392102956181882210076480457510403571920700264909856209592784791694868129108346011059587502901579488536825526600909065005464431207720468047844400155366255374467511796067334143740378071817982780952225290759528227052655526373770293819614012979844498214675357371718090188445779581050493467195256138164679148658135895303991821413666050604721201781084809842842
<FullMetalStacker> 03117352315518222422535385811809589105797428341472073316006102052626422913940403862178369360289150221545997413254091545760176678374925684523851282546634976740197443448393501641085068193233006569467725209289775777637844560362421275495681089556484552295413069602225119472180033964887267715089455573935066934723099570103188237119742301306068355398282758004300387637750776932123551358787503513567080588126335456953202731305853637360
<FullMetalStacker> 01271048369136551392713123213917629692468870693114596365931951164860052583187551163739244694287384119606016240813252479067377894618713050599519941333920849175720688426603686623727811778920575738313876942798831198034454183400528171451885839808081534557771814770784080521769026305973020050955893047948473171941769274318247187619127583638475013336893072773110719663559755419607246671514473845627449437821120323157069060336179399437
<FullMetalStacker> 97397416122479380037505288198451797220583765852560337423593825783133523227356419730804519221538272804180947534328234092041792200970030614429814851717220239843813065426559261699223012057593019453487849144572168641644238264658471527604758976803930869077289040286753055904466711979946279007917593793429403221054796812250475620788820842716739796610425767287742764747985140674079313284033669628214308952897873002644938006943265465739
<FullMetalStacker> 72889530152550832682915003248078360754512403209098531448119370760160962343641848766900539699313306314261036924654383511238976397004817130450932908501240748962887682292399890731149768389074685263922628969010325512312994939824399421291584610393416826429357186412173030636652895398969816273906685792009807782480190111796659155814731305592865099811278096754869996879001605660225933131720518564095530860716060831642563576564402599474
<FullMetalStacker> 18403520833055982715428132497141721776593232910023128434181671616993636576674649755163118115432421057280337803797501719103791925999816337294955834672799713372068390015982524918759541676376605014919424449299233811499087494973117533273532745509604615912273874405685699497107103446061346795318615529768919509615819483958000969371161407852226757224492897179773208105486376354493024962006775523553530145133926474580855310304425779435
<FullMetalStacker> 10504566928389894077885692838877924455965336050882611700573769283362786637908500121087413490919458524348730957886308382062062518359108652724688927941019789568415147390254834037496979068755523370040922327426069932679375727260727507121376840966197233771146945873677312750858671294255121013199928935516072162912021928838596278953473016836677149876464320273610062049353970355719628415841047177747078585637946306965207997604149495319
<FullMetalStacker> 29422571945937897622623029106735844961367258397066457408933959499754092272605653214269424825490257819946611041979127743942591501897758288674280164708098129802942621816541762347455927750217725761749876952089984538079542154313467051350560713080946610704833672914863444834077695618498825492916834544901525218047703616347352266780558294660490695571142708131248419113384780602917039289211889012098631834711667574510891598082791237511
<FullMetalStacker> 36813752381519134065459838375982019526282395176318960614479909820337118877226697121000238605360661401638160503960101803999730874042452368554112362299622723494092159353481787516709362106815063256371180265714980852613633828868251643142253848107535083857499875020021370656598386372250195439457000639001591423504791416550948989300484016850998719819060672648771083357956564194565469064529053847496744724041033579631052013014896705076
<FullMetalStacker> 53045447619611115827574513094278411912831257683889136087125965590477963972167768308790200056703301837363232452292754557721502727995163672563074572557445694884574666479390929983317263681526142055661274001304478435085627013205114977225043853447595898637610881298235949251138647260773997725305781287592880993172984786330503806585653608696259819255735110682215147500202502426140014587210291863699944318048368009728050507871502718757
<FullMetalStacker> 90588857568531983268948235369339306476196338702279451997359684319255470455071533803693443637987197312078606166048946291956762605002179147618961773963668039955568023396490667708464814945206174946540544433750314046178100391644232503503184257394931461133002612751949551277149792155541806999636857258350405445971921540594675261531726117474863451763324696900210487195191942201102467719620286291795167789539263028618726149150293626578
<FullMetalStacker> 57196726229669558404139640408745012570045857400366178251401210484567494780059425318633343816094161074119953492411450609419636171555616286194670983382627775777556819633778643143194322044918690136234897918785533094657171653712506118087314606520776729375918474392256737477965561108189467127574389319617828569054604874397377814670154669384782491815576413850136842196291976884222757683665122740038940119917370033013239430164780018439
<FullMetalStacker> 61353924115843873984710065363991365946288173224487735657259039187584749348034701056088882807152159957765213622488621224447781323533482873913950349320443470773035380486084641268032447768695439394185781269618335443190342904452390463082668906255100068763116142130780343253052399838339257264259123475659848227761990597598290652334444052994506729573628327054336622589236846241507017685967266017184192462125029771430194852970903273878
<FullMetalStacker> 26954939550982532750916169811628352716779360083965171990822747259453324546461295055053372372607328805201556009508897238318514734818107031558272717330427747470403681172499766543258489968071252977489020921921533482925174776369983198645927199040962825445205361239078516713459854789967086933674157664058871715312597175996281733053382868625559917026498883115523814814269562860602120839723332371424284563020359358041464480715691773416
<FullMetalStacker> 21453855357728697298922065989078435494522482467060558308342155289607095791353441970864578254213250537757884646888372437377768375379400303054016300658231424842888895939290831975156647132852366048015353688562630064641658267191891674678352191247456238096816362603229743286729349300440862676635203187632809151674244471450787459864881779254476343890773210369852055924856565177666587629650514087050991925215383308293950562958043290229
<FullMetalStacker> 15298090099547386100480761715832476971868489302700167581754355281323469197233999067444732385034264454341318033031034742752529488734701576769502605562969299676804030182541001465637192707160225009065292759187810509000098595455934744914673153799109147056877784188726005071493547212142261807722046022900133062535055213001926828590898628139745155658542900103250191493298597204133421330375523297391277441229750693420593003891778741633
<FullMetalStacker> 33757832057649902980646662273874361913705745737955960606935667516741606560077796022396016643814314494171330987251043856985130827142162465823710586717901801713377917656278564642681200957179693838433601071596627151197960806770161840228661912918418002153463448427742523657842530602639794922802862234856999542359332364028807667744693569008829276574041384632564708551717938319677060787638959227542727797644608118438472619580690861310
<FullMetalStacker> 03807373899878235618073773348584133829646840427964201787352522056623633255215690016310538120499003693489585579407040961492341327449856203616209988852024381026281362194846030841323647613467582188776522280023772054149673345961840828618868040788265383009374858721210113708481480657617476654983342772118182125850503048982686072581783262476230825943529963898171172795292296342240907777207345724927915838546796540212744803590952368639
<FullMetalStacker> 43164163976742353048017934648650552291193531299287333574731118861287141988081763367853361396163091721695816267966622884325996815780069112949455840556378181737665060537288390246568851872710323336775125307549927278102607372999433193816885138281678331046536331213457820816746878027849059417524555000961462235324372381772266080864913127989597181576154686575580551767557644044989203663408587601355490277788663550900305111085405514167
<FullMetalStacker> 30745594838351834584575357831698893348658141957159897340058567868748936626742347037866627097316341037240909323108663202878302223871290004378054620952462515922751522559715101798322354007582361109143698953931001991956342664674945989774832303515243489859309992832362195962026624277579713586391499823267237163502793543344284653813203484976071984514676139143483586717744855776904994053559217490507581888587937265470793537359153428503
<FullMetalStacker> 71100971420019024090678442026576093732437821014693383855236939385862185310566991309938201740514314970964601682087134244206717925297640930338082469075778693145676994230626816263232318041862151691307293023100704420922261697832627810801786199316929816486596316710243105405716004494259853069381500923740967771224741007844474631494514270365146758866652536422385786983693888091812664601545544643530042575137950091457045771168354070549
<FullMetalStacker> 53113795001756495599671751512327222694937625977536952510053776457358067234035215180509559272085970413093270335657825888719945759643821762929275931155816791783249623398972097750264122439157163976426709941950520639952620598992448460186576605436382792267690350713682072308043348881217444791537597235387312296108134468194614073722967276331948049416367876892522519113194379469730561709996738547045019016894009761701601047271755349545
<adam12> wtf
<FullMetalStacker> 17127216556147182341885394673918952430195137194844465388304639560420936454577480501147950814080283548446281918120871534119225756331468232041696455618949285834547578861046447630913859504404068112045480879441037042009821751738975896236429079696431957555508861925594496386445305512802413964349324764303163170030120051033304781386899647723407350599194254397370358552537154482796038198922647381259695863677312039152317252445588146397
<FullMetalStacker> 05260496900442616318198373665764297862907689401722951391393441674177880937478140132238888677815968080658363501993739755211970729744040514687178436572154515270521065301450960345726812050650528471360825456107577339644677818389207136847975521711654331085596602516007576251829259275014074092291256322279987167357188731429821526565371280097228961932525962838454743201815497390660750685062905945347310751222912199396772988275100801979
<FullMetalStacker> 26214002324017494924786004659088681126782089866742531253586043038941597248759749524785850127315429383360691462315405544036319901797804452623745102741322720006822861512397897295508955558504743632318426496337627194975146309740994511109044420759521920338028780063674944608835832552561690834132292929615231005544887598830623476947240296184557815486816434863219544277216489809050366755755200683871665615374232148694050518315938681937
<FullMetalStacker> 62492635801898850751459701817315591073546522296746215353571574266042874641420300327448818138938906813059387312559909257016722399411162318799070604467921698636078084413690501603060748585798509084407840498449222422564541319249151604755228866389672372784099342767730373639161164003529359872297726175033199945083815519337550115952196344117385639151212795109592948421536353401164869279540374189735821859382481190937595215730482033681
<FullMetalStacker> 82275956759517265166546673736010882407329014198475924309404007282543162126946830064497096819104889737176813104247176925025523951624291529210164334674454840746184467158837669570218897244532854661785801657614473577109927402355390073463211889856158460650251202729010881679572422722146792066777665792784753212898009038967875925924348832544203624929107460276233771078514162324568174410025857431916197301822428245399359065800996107254
<FullMetalStacker> 05229903003585057389115254425426294123774999242203818135570106625270469842018689410859362416361018727654791705547230219347793655406503544481387692133318113604605417706362158949278753877233231907369075384301758547610739309166631075155566933535699308118874030886955509844948712807426603924480316389475440361273001642997625400554045914009935378139758420737389722286880034254161785671921721481181959481256081043480784142549323225346
FullMetalStacker was kicked from #ruby by adam12 [FullMetalStacker]
stirl has quit [Ping timeout: 252 seconds]
FullMetalStacker has joined #ruby
<FullMetalStacker> I am sorry for the nuisance!
<adam12> FullMetalStacker: no prob :)
<adam12> FullMetalStacker: Maybe you can make it `.lazy`?
<adam12> n.digits.lazy.sum
<FullMetalStacker> @adam12 tried it out, still time outs after 12s. I have found a solution that works, i cut the number in chunks and process them separately, which completes after about 4 seconds. But my question remains, how can it be that the 2 alternatives I provided that are so similar in code can be so different in the result, and even the one that involves some more steps be the faster one than the .digit solution. i try to understand
<FullMetalStacker> what is so bad about the n.digits.sum that it times out while the other works perfectly fast
gcd has joined #ruby
<adam12> FullMetalStacker: It's a mystery.
<FullMetalStacker> what is so much better about this "workaround" n.to_s.chars.sum(&:to_i) than to go the .digits route?
<ox1eef_> Hahaha. Classic.
<adam12> I presumed it was the creation of the Array...
<adam12> Can you paste the numbers into a Gist?
<FullMetalStacker> @adam12 i did and provided it further up, but n.p., here it comes again: https://privatebin.net/?c2f6e8d519a21965#9RX2ZrSZ7ELtSmzt1GZ3nVb2RXVrkZabwTVmX9vvv3Ai
<FullMetalStacker> it is 30103 digits
<ox1eef_> that_str.to_i.digits.sum is almost instant for me.
<adam12> ox1eef_: What value do you get?
<FullMetalStacker> @ox1eef_ yes, but this is only 1 number of 105 such tests that are run that time out alltogether after 12 s
<ox1eef_> 134676 for both variants.
<weaksauce> which ruby FullMetalStacker
<adam12> It's instant here too.
<FullMetalStacker> i think i got the answer why there is such a difference, at least if chatgpt says the truth
<FullMetalStacker> 2.5.0
<FullMetalStacker> on codewars
<adam12> FullMetalStacker: I'm not sure I follow the issue :\
<weaksauce> FullMetalStacker yeah older rubies are much slower on that
<weaksauce> on 2.6 that took .019 seconds vs. 0.86 seconds
<weaksauce> but on 3.2 it's instant
<FullMetalStacker> @adam12 you were busy kicking me from the channel so you did miss stuff :-D i had written:
<FullMetalStacker> completed after 805ms for this: n.to_s.chars.sum(&:to_i)
<FullMetalStacker> #performance: I get these results:
<FullMetalStacker> timeout at 12 seconds for this: n.digits.sum
<FullMetalStacker> how is this explainable?
<weaksauce> in fact on 3.2 it's faster the second way
<adam12> FullMetalStacker: I saw that, but we just reproduced with no timeout with the data you provided.
<adam12> Unless it's a Ruby version issue. I'm just testing with the latest I have installed.
<weaksauce> adam12 it is
<weaksauce> 3.2 works an order of magnitude faster via the second method.
<FullMetalStacker> and chatGPT now explained this, no idea if it makes any sense, but at least it is an explanation: https://privatebin.net/?4309bca0b11871d9#4kFEoLJa7BHTApojkZKkhhy9vckSi1qRFk28YEKRmV6X
<adam12> weaksauce: ah
<weaksauce> while on 2.6 it's an order of mag slower
<adam12> I feel like ChatGPT halucinated part of that.
<weaksauce> chat gpt talking out its ass
<adam12> > In general, integers are represented as binary values in memory, while strings are represented as arrays of characters.
<adam12> Hmmm
<adam12> I mean, some of it sounds plausible.
_ht has quit [Remote host closed the connection]
<FullMetalStacker> i asked again, which more often than not reveals chatgpts mistakes. and indeed it now correct itself, in parts, but not as expected :-)
<ox1eef_> Reassuring to see ChatGPT get it wrong tbh.
<FullMetalStacker> here is the revision of chatgpt of what it said before: https://privatebin.net/?7247529567a7b4da#Ca6YFqkatMM7kedbhei23j5k94w9KnZ9pWB9n4KBkmdQ
<weaksauce> chatgpt is that guy that had to give a book report presentation and never read the book
<ox1eef_> xD
<FullMetalStacker> well for me as an newby-newcomer i keep this: whenever i touched .digits instead of .chars because i thought i could create better code, it bite me in the ass, revealing shortcomings of .digits that i did not know about. and this is again such a case. i guess in future i will just avoid it and stay with chars, even if it needs to get from integer to chars to integer, which i find ugly :-)
<ox1eef_> It's not on an issue on 3.X
<FullMetalStacker> interesting!
<FullMetalStacker> for anyone interested, this is the kata: https://www.codewars.com/kata/59a2af923203e8220b00008f
<FullMetalStacker> alright guys, thanks once again for your input! i love this group. even if some times i get kicked off the channel by adam12 for pasting in the wrong window :-P LOL
<FullMetalStacker> cheers!
<adam12> FullMetalStacker: LOL
<adam12> Seee ya.
<FullMetalStacker> Ruby 3 was a huge leap in regards of performance AFAIK. Does anyone know if the long term roadmap, like for Ruby 4, foresees again such a huge improvement, or has Ruby 3 topped out now at its peak max?
<weaksauce> ruby 4 is going to have full rubyGPT integration
<FullMetalStacker> what is rubyGPT? I guess you don't mean this, no? https://rubygpt.ai/ Or was it a joke? :-)
<weaksauce> it was a joke :)
<FullMetalStacker> I thought so, but then found that url and was like "errr, wait a moment whatsdat?" LOL
<FullMetalStacker> nice! Is this for real? the API is there, so absolutely doable.
plujon has joined #ruby
<plujon> I'm confused by bundle check and bundle install...
<plujon>
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<plujon> bundle check # The following gems are missing \n * date (3.3.3) \n * timeout (0.3.2)
<plujon> bundle install # ... Bundle complete! ... Bundled gems are installed into `./vendor/bundle`
<plujon>
<plujon> bundle check # The following gems are missing \n * date (3.3.3) \n * timeout (0.3.2)
<plujon> In other words, for me, `bundle check` says I need to run `bundle install`. I run `bundle install`, and it exit successfully, but `bundle check` prints the exact same error message.
<plujon> My production server is down because of this.
<weaksauce> did something change?
<plujon> I did 'bundle update' on a dev machine.
<plujon> (because of a CVE in rack)
<plujon> bundle install --force # interesting, says it can not find date-3.3.3.gem
<weaksauce> did you pin any versions?
<plujon> No
<plujon> I did, however try on the production server:
<weaksauce> that's kinda fraught with peril tbh
<plujon> mkdir /tmp/tmp && cp Gemfile /tmp/tmp && cd /tmp/tmp && bundle config unset deployment && bundle install && bundle config set deployment true && bundle install
<plujon> But it fails, as described above.
<plujon> Or rather, bundle install succeeds, but bundle check then fails.
<plujon> This reproduces for me with a single gem:
<plujon> gem 'mail'
<plujon> On Ubuntu 20.04.5 LTS, using default ruby and default bundler.
<weaksauce> which versions of everything?
<plujon>
<weaksauce> i mean most times you use a ruby version manager
<plujon> I don't use rvm
<weaksauce> not rvm
<plujon> ruby 2.7.0p0, bundler 2.1.4
<weaksauce> just one of them
<plujon> Those are the versions provided by /usr/bin/ruby and /usr/bin/bundle
<plujon> http://ix.io/4quh # Gemfile.lock
<plujon> bundle install --verbose says it is using: date (3.3.3) from /var/lib/gems/2.7.0/specifications/date-3.3.3.gemspec
<ox1eef_> gemspec isn't the contents of the gem.
<plujon> ... Using date 3.3.3 0: date (3.3.3) from /var/lib/gems/2.7.0/specifications/date-3.3.3.gemspec
<plujon>
<plujon> Odd, I wonder what that means...
<weaksauce> what about no gem at all
<ox1eef_> 'date' is part of the stdlib
<weaksauce> yeah
<plujon> There seems to be /var/lib/gems/2.7.0/gems/date-3.3.3
<plujon> No gem at all? hmm.
<ox1eef_> But you are using ./vendor/bundle. I think it needs to be there. Also make sure GEM_PATH includes that path.
<plujon> With no gem, "The Gemfile's dependencies are satisfied."
<ox1eef_> My guess is that bundler is looking in ./vendor/bundle, and not picking up date from /var/lib/.
<ox1eef_> You could try: rm -rf ./vendor/bundle; GEM_HOME="$HOME/.gems" GEM_PATH="$HOME/.gems" bundle install
<plujon> On another machine, with newer ruby and bundler, bundle install creates ./vendor/bundle/ruby/3.0.0/gems/date-3.3.3
<ox1eef_> Yeah, that's what I'd expect.
defectiverobot has joined #ruby
<plujon> On an older 18.04 LTS machine, 'bundle config set deployment true' does not have a noticeable effect: vendor is not created at all.
<plujon> So, why does bundler create vendor/bundle/ruby/2.7.0/gems/{mail-2.8.1,mini_mime-1.1.2,...,net-smtp-0.3.3} but not date-3.3.3? Maybe because date is in the standard library?
<ox1eef_> I usually set GEM_HOME / GEM_PATH, and install into GEM_HOME rather than use bundle install --path=.
<ox1eef_> I guess so. It sounds like some sort of bug.
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
<ox1eef_> And ubuntu / debiana are usually painful when it comes to Ruby / RubyGems.
sidetracking has joined #ruby
<plujon> I wonder why. Are there servers that are less painful?
defectiverobot has quit [Ping timeout: 276 seconds]
<plujon> So, what's the fastest way to fix a production server when this occurs...?
<weaksauce> fall back to a known good state and then make it work locally again
<weaksauce> incremental updates
<weaksauce> i'd personally avoid system rubies as they are kinda annoying to work with and harder to upgrade
<plujon> What do you use instead? I've also been bitten by rvm...
<adam12> plujon: Dokku (Docker Containers)
<weaksauce> I use rbenv and ruby-install. dokku is great too.
<weaksauce> though it's a bit more moving parts
ur5us_ has quit [Ping timeout: 255 seconds]
<plujon> adam12: Ir you use docker, do you not use bundler at all?
gonix has joined #ruby
<adam12> plujon: Sure. bundler inside docker.
<adam12> plujon: but if I build the image locally and it runs, then it will run in prod.
<plujon> rbenv install -l # lists versions I don't understand. rbx..?
<weaksauce> just an alternate installer
<weaksauce> er s/installer/ruby interpreter
<plujon> The vanilla version tops out at 2.4.1 in rbenv output.
dionysus69 has joined #ruby
<weaksauce> if you want to update it you can do rbenv install help
<weaksauce> and it will error and show you the command to pull
<weaksauce> something like git -C /some/path pull
<plujon> PHEW!
<plujon> To fix this problem: gem 'mail', '= 2.7.1'
FullMetalStacker has quit [Ping timeout: 248 seconds]
FullMetalStacker has joined #ruby
gonix has quit [Ping timeout: 255 seconds]
moldorcoder7 has joined #ruby