havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.1, 2.6.6, 2.5.8: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
CuriousErnestBro has joined #ruby
<CuriousErnestBro> hello
<CuriousErnestBro> i installed lunchy but it's not working
<CuriousErnestBro> zsh: command not found: lunchy
<CuriousErnestBro> what do I do?
<havenwood> CuriousErnestBro: Is `"$(gem env gemdir)/bin"` in your PATH?
<havenwood> CuriousErnestBro: printenv PATH
hassox has joined #ruby
<havenwood> CuriousErnestBro: echo "$(gem env gemdir)/bin"
<CuriousErnestBro> /usr/local/opt/ruby/bin is in my path
<havenwood> CuriousErnestBro: So Ruby's executables, like `ruby`, `gem`, and `ri` are available.
<CuriousErnestBro> the second command is: /usr/local/lib/ruby/gems/2.7.0/bin
stooj_ has joined #ruby
<havenwood> CuriousErnestBro: For gem executables to be available, the gem bin/ dir needs to also be in your PATH.
<havenwood> CuriousErnestBro: Is `lunchy` in that second directory?
<havenwood> CuriousErnestBro: stat /usr/local/lib/ruby/gems/2.7.0/bin/lunchy
<CuriousErnestBro> havenwood yes, it is
<havenwood> CuriousErnestBro: And you see it with?: command -v lunchy
<CuriousErnestBro> I did cd /usr/local/lib/ruby/gems/2.7.0/bin/; ls
<havenwood> CuriousErnestBro: Show us: stat /usr/local/lib/ruby/gems/2.7.0/bin/lunchy
<CuriousErnestBro> 16777220 12886290974 -rwxr-xr-x 1 zohaad admin 0 537 "May 6 01:45:11 2020" "May 6 01:45:11 2020" "May 6 01:45:11 2020" "May 6 01:45:11 2020" 4096 8 0 /usr/local/lib/ruby/gems/2.7.0/bin/lunchy
<havenwood> CuriousErnestBro: And the result of?: command -v lunchy
stooj has quit [Ping timeout: 256 seconds]
<CuriousErnestBro> havenwood that gives an error
<CuriousErnestBro> there's a red cross in front of my command line
<havenwood> CuriousErnestBro: What is?: echo "$(gem env gemdir)/bin"
hassox has quit [Ping timeout: 272 seconds]
<CuriousErnestBro> havenwood /usr/local/lib/ruby/gems/2.7.0/bin
<CuriousErnestBro> yes, ruby, gem and ri are available
<havenwood> So we've confirmed your binary gem dir is in your PATH and there's an executable `lunchy` file there.
<havenwood> CuriousErnestBro: Show result of?: which -a lunchy
<havenwood> CuriousErnestBro: And: gem which lunchy
<CuriousErnestBro> lunchy not found
<havenwood> It's very strange that `command -v` is not showing a command in your PATH...
<CuriousErnestBro> /usr/local/lib/ruby/gems/2.7.0/gems/lunchy-0.10.4/lib/lunchy.rb
SoF has quit [Quit: Ping timeout (120 seconds)]
<havenwood> CuriousErnestBro: Sec, I'll check out the gemspec of that gem.
SoF has joined #ruby
<havenwood> CuriousErnestBro: Can you show the exact output of? printenv PATH
<havenwood> CuriousErnestBro: Or at least the parts with the gemdir?
drincruz has joined #ruby
<CuriousErnestBro> /usr/local/opt/ruby/bin:/Users/zohaad/.pyenv/shims:/Users/zohaad/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
<havenwood> CuriousErnestBro: Ah, so I misunderstood and the executable dir for gems was never in PATH. That makes *much* more sense. :)
<havenwood> CuriousErnestBro: export PATH="/usr/local/lib/ruby/gems/2.7.0/bin:$PATH"
<havenwood> or
<havenwood> export PATH="$(gem env gemdir)/bin:$PATH"
<havenwood> (Same thing.)
<CuriousErnestBro> that works, thank you havenwood!
<CuriousErnestBro> I'm sorry, I'm new to this command line stuff
<havenwood> CuriousErnestBro: no prob! You'll probably want to add that export command to your ~/.zshenv file.
<CuriousErnestBro> as I understand it, lunchy is like systemctl for linux
<CuriousErnestBro> havenwood oh, I added it to ~/.zshrc
<CuriousErnestBro> is that wrong?
<CuriousErnestBro> I don't have a ~/.zshenv file, only zshrc and zsh_history
<havenwood> CuriousErnestBro: That's fine.
<havenwood> CuriousErnestBro: I put my environment variables in .zshenv, but I swear all shell conventions are just superstitions. :P
<havenwood> CuriousErnestBro: There are subtle differences that seldom matter.
<CuriousErnestBro> havenwood I got another question, doing `which ruby` gives: /usr/local/opt/ruby/bin/ruby But I also did `brew install ruby` and that's at /usr/local/Cellar/ruby/2.7.1_2/bin
<CuriousErnestBro> they both have the same version
<havenwood> CuriousErnestBro: You can see the order of the available Rubies in your PATH with: which -a ruby
<havenwood> CuriousErnestBro: The first one will win.
<havenwood> CuriousErnestBro: It's common, when you want multiple Rubies at once, to use a Ruby version switcher.
<CuriousErnestBro> havenwood so the question is, can I safely delete the brew version, I installed it following a stack overflow post
<havenwood> CuriousErnestBro: Yes, it's fine to install and uninstall the brew Ruby repeatedly.
<CuriousErnestBro> I get this:/usr/local/opt/ruby/bin/ruby
<havenwood> CuriousErnestBro: It can also harmoniously live alongside other Rubies with no problem.
<CuriousErnestBro> /usr/local/opt/ruby/bin/ruby
<CuriousErnestBro> /usr/bin/ruby
<CuriousErnestBro> yes, the first 2 lines are exactly the same, which is weird..
<havenwood> CuriousErnestBro: Folk often use chruby, rbenv, RVM, or asdf to switch Rubies on macOS.
<CuriousErnestBro> havenwood huh now lunchy is gone :(
<havenwood> CuriousErnestBro: The conventional wisdom is to just avoid using system Ruby for apps.
<CuriousErnestBro> apparently this "symbolic linking" thing is doing some weird stuff
<havenwood> CuriousErnestBro: How are you installing Ruby??
<CuriousErnestBro> `brew install ruby`
* CuriousErnestBro reinstalls ruby through brew
<havenwood> CuriousErnestBro: export PATH="$(gem env gemdir)/bin:$PATH"
<havenwood> CuriousErnestBro: You might consider just going straight to chruby. The brew Ruby actually works great once you setup your PATH, but it'll just be the latest version. If that works for you, you might not need a switcher like chruby.
<CuriousErnestBro> yes, I'm just installing ruby to get access to the lunchy tool
<havenwood> CuriousErnestBro: Or you can use chruby to setup PATH and other env vars for the brew Ruby.
<CuriousErnestBro> which I will use to run a postgres "service"(whatever that is)
<havenwood> CuriousErnestBro: You can just use launchy directly without any Ruby gem, if you like.
<havenwood> CuriousErnestBro: With Homebrew, you typically don't do any of the above, and just run:
<havenwood> brew services start postgres
<havenwood> CuriousErnestBro: Brew has it's own launchy interface that's nice for simple service management.
<CuriousErnestBro> ah yes, the tutorial mentions this too, but then goes on to say that I should use lunchy because it's simple
<havenwood> CuriousErnestBro: See: brew help services
<havenwood> CuriousErnestBro: I disagree. Just use brew services.
<havenwood> CuriousErnestBro: You are done after a single: brew services start postgres
<havenwood> CuriousErnestBro: Check running services with: brew services list
<havenwood> CuriousErnestBro: If you're just trying to run brew postgres, that's the way!
<CuriousErnestBro> okay I'll just keep the ~/.zshrc path variables, in case I need a gem app in the future
<havenwood> CuriousErnestBro: Yeah, it's worth having your gem bin/ dir in PATH, no doubt.
<havenwood> Someone should change the brew instructions to say that explicitly.
<CuriousErnestBro> and `gem uninstall lunchy` for now :)
<CuriousErnestBro> thanks!
<havenwood> you're welcome. happy hacking!
<havenwood> A more full-fledged guide, if you decide to go beyond brew Ruby: https://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you
gueorgui_ has joined #ruby
gueorgui has quit [Ping timeout: 260 seconds]
<CuriousErnestBro> thanks, will keep that in mind when/if I'll need to use ruby
banisterfiend has quit [Quit: banisterfiend]
Technodrome has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
<adam12> /usr/local/bundle/gems/sorbet-0.5.5579/bin/srb: line 120: 206 Killed "$srb_rbi_path" "init"
<adam12> Doh. Another day I guess.
CuriousErnestBro has left #ruby ["Textual IRC Client: www.textualapp.com"]
<adam12> I wonder how much RAM srb init actually needs on a project with some history.
rmnull has joined #ruby
ur5us has joined #ruby
sergioro has quit [Quit: leaving]
rcvalle has quit [Ping timeout: 260 seconds]
impermanence has joined #ruby
impermanence has quit [Client Quit]
impermanence has joined #ruby
Garb0_ has quit [Remote host closed the connection]
Garb0 has quit [Remote host closed the connection]
impermanence has quit [Quit: Connection closed]
drincruz has quit [Ping timeout: 256 seconds]
sergioro has joined #ruby
impermanence has joined #ruby
hassox has joined #ruby
hassox has quit [Ping timeout: 272 seconds]
baojg has joined #ruby
mkaito has quit [Quit: ZNC 1.7.5 - https://znc.in]
mkaito has joined #ruby
_aeris has joined #ruby
_aeris_ has quit [Ping timeout: 240 seconds]
_aeris is now known as _aeris_
madhatter has quit [Ping timeout: 265 seconds]
madhatter has joined #ruby
ChmEarl has quit [Quit: Leaving]
ericm has joined #ruby
ericm has left #ruby ["Leaving"]
ericm has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
hassox has joined #ruby
rmnull has quit [Quit: WeeChat 2.8]
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
SuperLag has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
cliluw has quit [Ping timeout: 260 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
polishdub has joined #ruby
_whitelogger has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
mheld has quit [Quit: Connection closed for inactivity]
donofrio has quit [Remote host closed the connection]
rcvalle has joined #ruby
minall has joined #ruby
minall has quit [Client Quit]
zapata has joined #ruby
polishdub has quit [Quit: leaving]
sauvin has joined #ruby
hassox has quit [Remote host closed the connection]
greypack has quit [Ping timeout: 246 seconds]
greypack has joined #ruby
burgestrand has joined #ruby
greypack has quit [Ping timeout: 256 seconds]
greypack has joined #ruby
imode has quit [Ping timeout: 246 seconds]
chalkmonster has joined #ruby
hiroaki has quit [Ping timeout: 272 seconds]
greypack_1 has joined #ruby
greypack has quit [Ping timeout: 258 seconds]
Vashy has quit [Ping timeout: 252 seconds]
sagax has joined #ruby
schne1der has joined #ruby
schne1der has quit [Client Quit]
schne1der has joined #ruby
vondruch has joined #ruby
sergioro has quit [Quit: Lost terminal]
chouhoulis has quit [Remote host closed the connection]
Vashy has joined #ruby
greypack_1 has quit [Ping timeout: 272 seconds]
greypack has joined #ruby
rmnull has joined #ruby
rmnull has quit [Client Quit]
cliluw has joined #ruby
szqdsegrhrdgdrg has joined #ruby
<szqdsegrhrdgdrg> hi
d3bug has quit [Quit: Connection closed for inactivity]
<jhass> hi
cliluw has quit [Ping timeout: 240 seconds]
<szqdsegrhrdgdrg> Is it necessary to destruct the session cookie after user is logout ?
Vashy has quit [Ping timeout: 252 seconds]
ldepandis has joined #ruby
<szqdsegrhrdgdrg> I mean the session is destruct in the server, but the cookie is still in the user browser. Should I programmaticaly delete it ?
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
felix_221986 has joined #ruby
hiroaki has joined #ruby
Technodrome has joined #ruby
Garb0 has joined #ruby
Garb0 has quit [Max SendQ exceeded]
Garb0 has joined #ruby
<jhass> you should use some authentication framework like devise that deals with details like this for you :)
cisco has joined #ruby
<jhass> (but yes, you should at least attempt to destroy the cookie=)
<szqdsegrhrdgdrg> why ?
<jhass> why to which point?
<szqdsegrhrdgdrg> the session cookie is no longer valid, so why remove it ?
<jhass> maybe your session invalidation has a bug in it, why keep it around and make it more likely to be stolen? Why let intermediaries keep using it to track/reidentifiy the user if you have no purpose for it whatsover anymore?
<jhass> I think it's just basic hygenie, clean up what you don't need anymore
dionysus69 has joined #ruby
<szqdsegrhrdgdrg> jhass ok thanks
Vashy has joined #ruby
Vashy has quit [Ping timeout: 252 seconds]
ur5us has joined #ruby
szqdsegrhrdgdrg has left #ruby [#ruby]
Vashy has joined #ruby
baojg has joined #ruby
chalkmonster has quit [Read error: Connection reset by peer]
schne1der has quit [Quit: schne1der]
chalkmonster has joined #ruby
TomyWork has joined #ruby
gitter1234 has joined #ruby
Garb0 has quit [Remote host closed the connection]
Garb0 has joined #ruby
stooj_ has quit [Quit: ZNC 1.7.5 - https://znc.in]
stooj has joined #ruby
felix_221986 is now known as fandre1986
conta has joined #ruby
xco has joined #ruby
chouhoulis has joined #ruby
fandre1986 is now known as gato
chouhoulis has quit [Ping timeout: 256 seconds]
conta has quit [Quit: conta]
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
gato has quit [Quit: Connection closed]
felix_221986 has joined #ruby
ellcs has joined #ruby
burgestrand has quit [Quit: burgestrand]
felix_221986 is now known as gato
sergushakov has joined #ruby
schne1der has joined #ruby
ellcs has quit [Ping timeout: 256 seconds]
MrCrackPot has joined #ruby
MrCrackPot has quit [Remote host closed the connection]
jingjinghack has joined #ruby
gato has quit [Quit: Connection closed]
gato has joined #ruby
mjsir911 has quit [Remote host closed the connection]
mjsir911 has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
krillbat has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
canton7 has quit [Quit: ZNC - http://znc.in]
burgestrand has joined #ruby
donofrio has joined #ruby
canton7 has joined #ruby
chalkmonster has quit [Read error: Connection reset by peer]
cisco has quit [Ping timeout: 258 seconds]
baojg has quit [Remote host closed the connection]
cisco has joined #ruby
chalkmonster has joined #ruby
baojg has joined #ruby
vondruch has quit [Ping timeout: 260 seconds]
burgestrand has quit [Quit: burgestrand]
kristian_on_linu has joined #ruby
burgestrand has joined #ruby
shokohsc has joined #ruby
fercell has joined #ruby
conta has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
jinie has joined #ruby
wilhelm418 has joined #ruby
conta has quit [Quit: conta]
cd has quit [Quit: cd]
Technodrome has joined #ruby
cisco has quit [Ping timeout: 246 seconds]
burningserenity has joined #ruby
jetchisel has quit [Ping timeout: 258 seconds]
krillbat has quit [Quit: Connection closed for inactivity]
TCZ has joined #ruby
jetchisel has joined #ruby
vondruch has joined #ruby
drincruz has joined #ruby
gitter1234 has quit [Quit: Connection closed for inactivity]
drincruz has quit [Ping timeout: 246 seconds]
drincruz has joined #ruby
vdl has quit [Ping timeout: 256 seconds]
baojg has quit [Remote host closed the connection]
stryek has joined #ruby
greypack has quit [Quit: All your IRC are belong to ZNC]
greypack has joined #ruby
gato has quit [Quit: Connection closed]
baojg has joined #ruby
kinduff has quit [Ping timeout: 256 seconds]
gray_-_wolf has joined #ruby
cow[moo] has quit [Quit: Textual IRC Client: www.textualapp.com]
kinduff has joined #ruby
greypack has quit [Ping timeout: 246 seconds]
cow[moo] has joined #ruby
sergushakov has quit [Quit: WeeChat 2.3]
greypack has joined #ruby
jingjinghack has quit [Quit: WeeChat 2.1]
finchfiler has joined #ruby
d3bug has joined #ruby
finchfiler has quit [Quit: Connection closed]
e2 has quit [Quit: Stable ZNC provider ##bnc4you]
hassox has joined #ruby
rmnull has joined #ruby
akem has quit [Remote host closed the connection]
sergioro has joined #ruby
hassox has quit [Remote host closed the connection]
e2 has joined #ruby
<adam12> Not sure this is even possible but has anybody ever seen a block rebound to another binding that might have access to refinements?
<jhass> uh, shouldn't be too hard to try out?
TCZ has quit [Quit: Leaving]
<jhass> might depend on the ruby version, refinements still saw touchups in up to 2.6
<adam12> jhass: I've tried multiple routes but no joy.
<adam12> jhass: I'm presuming it's not possible due to the lexical scoping of refinements but was hoping someone might have seen something on their travels :)
rmnull has quit [Ping timeout: 244 seconds]
Esa__ has joined #ruby
conta has joined #ruby
wymillerlinux has joined #ruby
baojg has quit [Remote host closed the connection]
SeepingN has joined #ruby
<havenwood> adam12: That reminds me of this issue ticket: https://bugs.ruby-lang.org/issues/16461
<adam12> havenwood: Interesting. I went through the bug tracker and didn't see this one. Thanks for linking it.
akem has joined #ruby
burgestrand has quit [Quit: burgestrand]
BTRE has quit [Read error: Connection reset by peer]
kristian_on_linu has quit [Remote host closed the connection]
conta has quit [Quit: conta]
burningserenity has quit [Remote host closed the connection]
baojg has joined #ruby
baojg has quit [Remote host closed the connection]
fercell has quit [Quit: WeeChat 2.8]
lxsameer has quit [Ping timeout: 260 seconds]
xco has quit [Quit: Textual IRC Client: www.textualapp.com]
rippa has joined #ruby
xco has joined #ruby
sergushakov has joined #ruby
xco has quit [Client Quit]
bovis has joined #ruby
dionysus69 has quit [Ping timeout: 258 seconds]
<bovis> In main, I'd like to define a date-start and date-end as variables, then using those variables in external files that contain json. Using 'require 'jsonfile'', I run into a NameError for date-start. What's the easiest way around this problem?
lxsameer has joined #ruby
dionysus69 has joined #ruby
dionysus69 has quit [Client Quit]
dionysus69 has joined #ruby
xco has joined #ruby
BTRE has joined #ruby
caterfxo has quit [Quit: leaving]
ChmEarl has joined #ruby
<Iambchop> bovis: can you paste your actual code? https://dpaste.de and/or describe what you want your program to do
<jhass> bovis: yes local variables are lexically scoped, that is to the file. Maybe you want to use CONSTANTS instead?
caterfxo has joined #ruby
imode has joined #ruby
imjoehaines has joined #ruby
kickr has joined #ruby
howdoi has joined #ruby
kickr has quit [Client Quit]
<bovis> Iambchop: https://dpaste.org/ej49 More or less, the only thing I'm doing is moving Line 6 to a new file
<bovis> That's a simplified version. I want to move the data because it's become so large.
<bovis> jhass: I don't know if constants would be the right way to go. I'm ending up with a lot of variables I want to reuse across multiple files.
<jhass> could also have some kind of object holding configuration, for example a Struct https://ruby-doc.org/core-2.7.1/Struct.html
<jhass> then assign that object to a constant
<jhass> So you could end up with for example Config.start_date
<jhass> with many members you want to set keyword_init to true I'd say https://ruby-doc.org/core-2.7.1/Struct.html#method-c-new
<bovis> jhass Iambchop: I had thought about just pulling in raw data and assigning/reassigning as necessary. For instance, instead of {"item": { "start": datestart, "end": dateend}, I have {"item": { "start": "", "end": ""}, assign that hash in main, and then on a per-assignment basis, state what I want start and end to be, along with any other elements I know I'll want to change
jcalla has joined #ruby
rmnull has joined #ruby
<bovis> jhass: I tried attr_reader and changing the variables in the external file to dates.datestart, but I ended up with the same NameError. Would that happen with a struct?
<jhass> bovis: the struct is just a shorthand to defining a class. The key is the local_variables are lexically scoped to their file. They will never ever appear in another file. Only $global variables (don't use them, really) and Constants are globally scoped
<jhass> so the simplest solution probably is turning all your configuration local variables into a constant. Slightly cleaner could be collecting them into some kind of class and then assigning an instance of that class to a constant
<jhass> there's probably designs to do what you do to avoid either of that by introducing classes to represent entities and procsses in your program and then passing around instances of that etc
<jhass> but that's beyond anything that can be reasonably described here, especially since it's highly specific to what you do exactly, which you have not shared
gray_-_wolf has quit [Quit: WeeChat 2.8]
<bovis> jhass: Sorry to not be specific. There really isn't any more to the problem than the code in https://dpaste.org/ej49 . It's a matter of having variables referenced in one file but created in another. I think assigning a class to a constant is exactly what I need. This is a toy project; nothing that needs a highly specific fix or to be overengineered
<jhass> sure, fair. Just listing the options :)
darkstardev13 has quit [Remote host closed the connection]
darkstardev13 has joined #ruby
<bovis> jhass: Much appreciated
gueorgui_ is now known as gueorgui
rmnull has quit [Ping timeout: 260 seconds]
rakm has joined #ruby
<rakm> hi there, i'm struggling to understand something. i'm running ruby 2.5.1 and doing require 'rubygems/package' and then using the `Gem::Package::TarReader` class in some code. This code has a bug that was fixed here: https://github.com/rubygems/rubygems/pull/2780. Is there a way to adopt this change *without* running `gem update --system` and without upgrading ruby itself?
<rakm> I tried adding `gem 'rubygems-update', '~> 3.0.5'` in my Gemfile and bundling, but that doesn't seem to do the trick
<rakm> i'm missing some high level understanding of how the `Gem` class and `rubygems-update` are related
<SuperLag> cbcoredumps = Dir.glob('core.*').sort_by { |f| File.mtime(f) } <-- what is the |f| called? I'm trying to figure out what that is, so I can look it up in Ruby documentation. I get this much... declaring a var called "cbcoredumps" that is a list of core.* from the current directory
schne1der has quit [Ping timeout: 256 seconds]
burgestrand has joined #ruby
burgestrand has quit [Client Quit]
<jhass> rakm: did you try putting a newer version of rubygems itself into your Gmefile?
<jhass> ah nvm, for some reason I thought there's a gem packaging it up
<rakm> @jhass yeah that's one of the things i'm confused about. does `rubygems-update` not contain rubygems itself? what exactly does `gem update --system` do, and what exctly does rubygems-update do?
<rakm> I don't see rubygems itself as a gem: https://rubygems.org/search?utf8=✓&query=rubygems
<jhass> I'm afraid you'll have to get another ruby, if not a newer one, one where you can update rubygems. One venue could be using a ruby version manager (RVM, rbenv, chruby/ruby-install) to install a site local ruby
<rakm> so how would I know what version of rubygems is included in ruby?
<jhass> gem -v
<rakm> so i'd have to install it first to find out?
<jhass> mmh, I guess it's documented somewhere or could be read from the source code at the release tag
<jhass> but it doesn't matter, if you get a site local ruby you can just update rubygems within it
<jhass> without touching your system
<rakm> whoa, ok can you break that down for me? What is "site local ruby" do you just mean rbenv/rvm?
<jhass> yes, I just mean RVM/rbenv/chruby(ruby-install)
<havenwood> rakm: RubyGems is itself a gem but it doesn't ship itself as a gem package. The `gem update --system` command bootstraps an update or the rubygems-update gem provides the update_rubygems command.
<havenwood> rakm: Ruby ships with a particular version of RubyGems, but it can be updated via either `gem update --system` or `update_rubygems` commands without updating Ruby itself.
<rakm> hmm ok. so the context here is that i'm running some stuff in CI which is based on a docker image that has ruby 2.5.1. I *can* rbenv install an update, but that's slow. I can also use a newer image, but am trying to avoid that until i understand really what's going on
<SuperLag> jhass: you rock
<havenwood> rakm: Use the latest stable 2.5 in any case—so 2.5.8.
<havenwood> rakm: 2.5.1 has known security issues.
<havenwood> rakm: It'd probably be worth going ahead to 2.6.6 or better yet 2.7.1, but 2.5.8 is a no-brainer.
rmnull has joined #ruby
<havenwood> Do it!
<rakm> yeah for sure, that's the plan. but i'm more just wondering how this all fits together right now
<havenwood> rakm: RubyGems is a gem that's part of the Ruby standard library. New versions of Ruby ship new versions of RubyGems. You can update RubyGems without updating Ruby, to an extent.
<rakm> ok so next question is... when I `require 'rubygems/package`, how do I know what is actually getting resolved? e.g. if I run `gem update --system` vs `update_rubygems`, how do I know which rubygems code will actually be loaded?
rmnull has quit [Client Quit]
<havenwood> rakm: If you want, you can download the latest RubyGems tarball, unpack it and run: ruby setup.rb
<havenwood> rakm: Or the `gem update --system` or `update_rubygems` commands will also get you the latest.
<havenwood> rakm: It'll update to latest supported. You don't know the version unless you choose it yourself, like: update_rubygems --version="3.1.3"
kinduff has quit [Read error: Connection reset by peer]
<jhass> the commands a synonmym and will touch your ruby installation. Each ruby installation can only have on rubygems version installed (apparently)
<jhass> *are synonym
kinduff has joined #ruby
Tempesta has quit [Ping timeout: 240 seconds]
<SuperLag> jhass: I rest my case. :D
<rakm> interesting... ok. going to try one thing... rbenv install 2.5.1, then track changed to ~/.rbenv/versions/2.5.1/lib/ruby/site_ruby/2.5.0 before and after `gem update --system`. If I understand correctly the definition of `Gem::VERSION` constant in that folder will change before and after and $LOAD_PATHS should stay the same
<rakm> (although kind of confusing why that path is `site_ruby/2.5.0` instead of 2.5.1
chalkmon1 has joined #ruby
<jhass> in the paths it's the ABI version, not the interpreter version :)
<jhass> so you can update your patchlevel without having to rebuild gems with native extensions
chalkmonster has quit [Ping timeout: 260 seconds]
<havenwood> rakm: Update your ruby-build package and: rbenv install 2.5.8
<havenwood> rakm: 2.5.1 is old. 2.5.8 will *just work*.
<havenwood> rakm: The ABI for 2.5.8 is also 2.5.0.
<rakm> oh what is ABI?
<rakm> havenwood: thanks for the suggestion to ugprade ruby, but as I said, that option is more complicated at the moment (i'll get there)
<rakm> ah ok cool, thanks
buckworst has joined #ruby
xco has quit [Quit: Textual IRC Client: www.textualapp.com]
<rakm> hmm interesting so what happens is that `~/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb` contains the default Gem::VERSION constant at 2.7.6. when I run `gem update --system`, it adds a file at `~/.rbenv/versions/2.5.1/lib/ruby/site_ruby/2.5.0/rubygems.rb` (note that additonal site_ruby directory)
<rakm> s/additional/nested
chalkmon1 has quit [Quit: WeeChat 2.8]
imjoehaines has quit [Quit: rirc v0.1.2]
chalkmonster has joined #ruby
imjoehaines has joined #ruby
cliluw has joined #ruby
renich has joined #ruby
burningserenity has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
cd has joined #ruby
cliluw has quit [Ping timeout: 260 seconds]
cliluw has joined #ruby
gix has joined #ruby
TomyWork has quit [Remote host closed the connection]
leitz has joined #ruby
<leitz> I'm doing something seriously wrong, but not sure what. Dealing with large-ish datasets. Is the Hash.transform! removing non Integer keys? https://gist.github.com/LeamHall/aa9eaf02cb5e0fb3a52747f820da5b48
chouhoulis has joined #ruby
burningserenity has quit [Ping timeout: 240 seconds]
<jhass> leitz: what happens in your transform_values! block if v is not an integer?
<jhass> what's the return value of the block then?
chalkmonster has quit [Quit: WeeChat 2.8]
burningserenity has joined #ruby
* leitz is testing
<havenwood> leitz: That if statement returns `nil` not `v` in the second case.
<havenwood> leitz: v.is_a?(Integer) ? v.to_s : v
davispuh has joined #ruby
<leitz> havenwood, thanks! It's afternoon for me, and my brain has called it a day. :)
postmodern has joined #ruby
Tempesta has joined #ruby
CrazyEddy has joined #ruby
vondruch has quit [Ping timeout: 256 seconds]
Vashy has quit [Ping timeout: 252 seconds]
burningserenity has quit [Remote host closed the connection]
maths22 has joined #ruby
TvL2386 has quit [Ping timeout: 256 seconds]
xco has joined #ruby
<maths22> I'm noticing a behavior change between ruby 2.5 and ruby 2.6 that doesn't appear intentional/called out on any release notes, but before I file a bug I want to make sure that I'm not missing something
<havenwood> maths22: Gist a reproduction script?
<maths22> On ruby 2.4/2.5, `Signal.trap("CLD") { puts "Child died" }; system("true")` exits without printing anything
<maths22> On ruby 2.6, it prints 'Child died'
<maths22> I'm pretty sure it's an unintended side-effect of https://github.com/ruby/ruby/commit/054a412d540e7ed2de63d68da753f585ea6616c3
<maths22> But I'm less certain on the "unintended part"
Garb0 has quit [Quit: Leaving]
<havenwood> maths22: I can reproduce it changing in from 2.5 to 2.6 but I'm not sure if it's intended either.
<havenwood> maths22: FWIW, it's also `Child died` on TruffleRuby.
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #ruby
dostoyevsky has quit [Client Quit]
dostoyevsky has joined #ruby
<maths22> Going by https://github.com/ruby/ruby/commit/6b87ac68dba3d8967d76233766a174c8a82813e3 I *think* the "correct" behavior is that it doesn't call the trap
Vashy has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schne1der has joined #ruby
S0bait has joined #ruby
<S0bait> How do I differentiate between a value in an array that is nil or a value that does not exist outside of the size of an array?
<jhass> use #fetch
dionysus69 has quit [Ping timeout: 264 seconds]
<havenwood> S0bait: +1 #fetch or #dig if it's nested.
<jhass> or just manually bounds check using #size
<jhass> depends a bit on the usecase
<jhass> maybe you can just #compact to know there's no valid nil values
<S0bait> Amazing, thank you
<S0bait> Fetch is perfect for my needs!
rakm has quit [Quit: Connection closed for inactivity]
wilhelm418 has quit [Ping timeout: 260 seconds]
S0bait has quit [Quit: Leaving.]
TCZ has joined #ruby
dnadev2 has joined #ruby
<KrzaQ> is there a way to restart function execution retry-like, but without exceptions? If I get 401 (which is not an execption) I want to relogin and try again
TvL2386 has joined #ruby
minall has joined #ruby
<minall> Hello Ruby community!, I
<minall> I'm trying to install the json gem... But I can't find how on Ubuntu, can someone help me?
<havenwood> Minall: json ships with the Ruby stdlib.
<minall> For installing the pg gem, I had to install a developer pg package on Ubuntu, but I can't find anyone for json
<havenwood> Minall: https://stdgems.org/json/
<minall> You say it is already installed?, then why do I get error when trying to install it?: gem install json -v '1.8.3'
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
troulouliou_div2 has joined #ruby
schne1der has quit [Ping timeout: 256 seconds]
<havenwood> Minall: What error do you get?
<minall> cc1: warning: unrecognized command line option ‘-Wno-self-assign’
<minall> Thanks havenwood
<havenwood> Minall: That looks like a compiler warning since it's a quite old version of the JSON gem.
<minall> havenwood: So I can't install it? then I'll look for another way of doing what I want
<havenwood> Minall: The JSON gem ships with Ruby. You can install a newer version if you'd like.
<havenwood> Minall: You're using an ancient version, it looks like.
<havenwood> Minall: With a modern Ruby, you'll get an updated JSON gem out of the box.
<minall> I'm trying to -bundle install- in an old rails project so... I'll just update it to the newest rails
<minall> Thanks for the help havenwood
<havenwood> Minall: No prob. Any time.
bovis has quit [Quit: leaving]
Technodrome has joined #ruby
dnadev2 has quit [Quit: Leaving]
rmnull has joined #ruby
rmnull has quit [Client Quit]
imode has quit [Ping timeout: 246 seconds]
minall has quit [Remote host closed the connection]
TCZ has quit [Quit: Leaving]
davispuh has quit [Ping timeout: 260 seconds]
gitter1234 has joined #ruby
davispuh has joined #ruby
Rescenic has joined #ruby
Rescenic has quit [Quit: Leaving]
nchambers has quit [Read error: Connection reset by peer]
uplime has quit [Read error: Connection reset by peer]
Reszenic has joined #ruby
ElFerna has joined #ruby
Reszenic has quit [Quit: Leaving]
imode has joined #ruby
johnny56 has joined #ruby
ElFerna has quit [Quit: ElFerna]
johnny56_ has quit [Ping timeout: 265 seconds]
leitz has quit [Quit: Leaving]
stryek has quit [Quit: Connection closed for inactivity]
ElFerna has joined #ruby
tau has joined #ruby
buckworst has quit [Quit: WeeChat 2.8]