<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]
<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]
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...
<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.
<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 :-)
<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:
<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.