oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
DTZUZO has quit [Ping timeout: 245 seconds]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
jenrzzz has joined #ruby
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
involans has joined #ruby
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
<adam12>
dionysus69: Does that solution not work?
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
jenrzzz has quit [Ping timeout: 258 seconds]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
conta1 has joined #ruby
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
yqt has joined #ruby
morenoh11 has joined #ruby
absolutejam4 has joined #ruby
yqt has quit [Ping timeout: 268 seconds]
morenoh11 has quit [Ping timeout: 272 seconds]
Rapture has joined #ruby
wildermind has joined #ruby
Inline has joined #ruby
Tuor has quit [Quit: Konversation terminated!]
absolutejam4 has quit [Ping timeout: 246 seconds]
MindSpark has joined #ruby
<MindSpark>
hey, I have a Rakefile that is including some packages. When I run rake, I get the error "LoadError: cannot load such file -- ra10ke"
gremax has joined #ruby
<MindSpark>
Although I have the gems installed via bundler. Sorry, total noob here.
DaRock has quit [Ping timeout: 245 seconds]
<MindSpark>
Anyone?
griffindy has quit [Ping timeout: 245 seconds]
matheusmoreira has quit [Ping timeout: 268 seconds]
andikr has quit [Remote host closed the connection]
matheusmoreira has joined #ruby
<adam12>
MindSpark: How about prefixing your rake command with `bundle exec`?
andikr has joined #ruby
chalkmonster has joined #ruby
<MindSpark>
adam12, I think I figured it out. I needed to set $GEM_HOME and $GEM_PATH, or one of them.
<adam12>
MindSpark: You shouldn't have to...
<MindSpark>
how come?
<adam12>
MindSpark: Well, what did you have to set them to?
<MindSpark>
I set them to ~/.gem
<adam12>
MindSpark: Bundler alleviates the need for setting $GEM_HOME and $GEM_PATH.
<MindSpark>
I think it's because I installed ruby via the puppet package instead of the default package manager?
GodFather has joined #ruby
<MindSpark>
adam12, does that also apply to rake?
<MindSpark>
Because bundler itself ran fine
<MindSpark>
but when I ran rake, that's the error I got
<adam12>
MindSpark: Bundler is basically 2 components. One part is depedency resolution / installation, and the other part is path management.
ramfjord has joined #ruby
<adam12>
MindSpark: Bundler knows where it installed the gems, so when you need a gem, it's possible it's not installed in GEM_HOME but bundler knows that, so it manipulates the path.
<adam12>
MindSpark: The two ways it does that are either, bundle exec being used, or require "bundler/setup"
<adam12>
MindSpark: Rake is a system gem and installed outside of bundler, so it can be called directly, but the second you require a gem managed by bundler, it needs that load path manipulated. Either require "bundler/setup" at the top of your Rakefile or prefix your commands with bundle exec.
jefffrails35 has joined #ruby
jefffrails35 has quit [Remote host closed the connection]
<MindSpark>
Ah, ok... I'll try to require bundler/setup
<MindSpark>
LoadError: cannot load such file -- bundler/setup
<adam12>
Is your GEM_HOME and GEM_PATH environment variables still set/different?
<MindSpark>
I unset them
<adam12>
Maybe they had defaults.
<adam12>
Did you set them, and _then_ install bundler?
<MindSpark>
nope
<MindSpark>
I set them after I installed bundler and things weren't working
<adam12>
MindSpark: Interesting. Well you could just re-install bundler or re-set the GEM_HOME and GEM_PATH. But something has gone hinky and it's too hard to determine what.
<MindSpark>
I am guessing that if you install ruby via apt or rpm or aio or w/e, the environment is added into etc/bash.profile /
<MindSpark>
And in that case it applies to all users?
ramfjord has quit [Ping timeout: 272 seconds]
<MindSpark>
adam12, can you try and echo $GEM_PATH and $GEM_HOME on your machine?
lxsameer has quit [Ping timeout: 258 seconds]
<MindSpark>
One thing to note of course is that my bundler and bundle binaries are in ~/.gem/bin. Which currently is not set in my path
schne1der has quit [Ping timeout: 258 seconds]
<adam12>
MindSpark: Both of mine are unset by default. I use direnv when working on projects and use GEM_HOME there (but never GEM_PATH)
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mdl8165 has joined #ruby
<MindSpark>
yes, well it works when I have GEM_HOME set. I don't have to have GEM_PATH really. I think they're interchangeable
<adam12>
MindSpark: A lot of package managers butcher the ruby install. Eventually I think ~/.gem will be default for `gem` command (I believe it's user-install option defaults to it)
mdl8165 has quit [Client Quit]
<adam12>
MindSpark: Ideally: you only need GEM_HOME set if you're installing gems as non-root.
<adam12>
MindSpark: If you are using bundler, you need to ensure bundler is used. This can either be through it's binstubs, bundle exec, or require bundler/setup as mentioned.
<adam12>
MindSpark: Outside of that, it should just work :)
involans has quit [Ping timeout: 245 seconds]
oetjenj has joined #ruby
<MindSpark>
adam12, what about bundle exec? Do I just execute this before I include any gems?
<adam12>
MindSpark: bundle exec is used before calling any gem binaries. bundle exec rake, bundle exec rails, etc. The bundle exec portion sets up the $LOAD_PATH to find the bundle'd gem, not the one that might be installed elsewhere / outside of the load path.
<adam12>
morenoh11: It's very out of place to see use of `for` in Ruby. Most people use the iterators provided by Enumerable. So answers.each rather than the use of for.
<havenwood>
plujon: For your example, if it's only a single level deep, you can: h.sort.to_h { |key, value| [key, value.sort.public_send("to_#{value.class.name.chr.downcase}")] }
<havenwood>
plujon: (replace that #to_h with #map and a #to_h on the end with an older Ruby)
<adam12>
morenoh11: What should the result of that be?
<plujon>
havenwood: Wowza. Thanks I wouldn't have thought of the public_send approach..
<morenoh11>
I'm not too concerned with the Integer bit, just trying to get ruby loops and hash
<havenwood>
plujon: There are many ways to do it! I might end up refactoring that to something a bit more straightforward.
<adam12>
morenoh11: I'm presuming you're talking about updating the hash around line 1$?
<adam12>
morenoh11: line 14 rather?
chalkmonster has quit [Quit: WeeChat 2.5]
<adam12>
morenoh11: If that's the case, what you're getting as 'value' is actually a value, not a reference. When you mutate it (value -= 2), you get another value. It's not touching the reference at all which remains the same. You likely want to re-assign it. hash[key] -= 2 or hash[key] = value - 2.
<havenwood>
adam12: `lamba(&prok)` or `prok.curry` gets you an unfrozen version, fwiw.
<havenwood>
lambda*
<havenwood>
#to_proc stays frozen
<adam12>
havenwood: I wonder the benefit to freezing the proc.
<havenwood>
keeps longer
<havenwood>
j/k
falconfox has quit [Ping timeout: 248 seconds]
<havenwood>
adam12: Nobody will go adding singleton methods to it if you freeze it. Trying to think of other wins...
<havenwood>
¯\_(ツ)_/¯
<adam12>
havenwood: lulz. I like my proc's to be freeze dried and then rehydrated.
* adam12
goes to submit PR to ruby-lang/ruby for Object#rehydrate
LtHummus has joined #ruby
<leftylink>
surely they would have added transform_values before transform_keys
<leftylink>
transform_values is more aplpicable and requires less care than transform_keys (for the latter, one has to think about what happens if you map two former keys to the same new key)
galaxie has quit [Ping timeout: 260 seconds]
dellavg has quit [Ping timeout: 268 seconds]
xco has quit [Quit: xco]
deepredsky has joined #ruby
absolutejam has joined #ruby
galaxie has joined #ruby
griffindy has quit [Remote host closed the connection]
deepreds1 has quit [Ping timeout: 272 seconds]
zapata has joined #ruby
morenoh11 has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
<morenoh11>
adam12: yes, is there a way to update a has as you iterate or should I construct a new one
<morenoh11>
hash*
mdl8615 has quit [Ping timeout: 245 seconds]
ellcs has joined #ruby
jenrzzz has joined #ruby
absolutejam has quit [Ping timeout: 258 seconds]
Jonopoly has joined #ruby
KindOne is now known as uplime
fphilipe has joined #ruby
morenoh11 has quit [Ping timeout: 272 seconds]
plujon has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
agent_white has joined #ruby
nowhere_man has joined #ruby
absolutejam has joined #ruby
heyimwill has joined #ruby
_sfiguser has joined #ruby
xco has joined #ruby
ur5us has joined #ruby
<_sfiguser>
guys i just started ruby and i really like the language... i was wondering if the ruby language is alive in 2019 and if new projects are implemented in ruby...
krasnus has joined #ruby
<_sfiguser>
i mean i want to spend some time learning some modern language i can use for network programming and for writing scripts for network security assessment and system admin
<_sfiguser>
leftylink, ok if i sort by recently updated i get this Updated on Sep 27, 2018
SeepingN has joined #ruby
<leftylink>
counterexample, https://github.com/rails/rails is certainly written in ruby and was certainly updated more recently than september 27
kaiser0 has quit [Quit: Leaving]
<havenwood>
_sfiguser: At Square we create a new Ruby app and gem about once a month these days, fwiw.
yalue has quit [Quit: Leaving]
<_sfiguser>
what about multithreading does it also have the GIL as python?
xco has quit [Quit: xco]
<havenwood>
_sfiguser: The reference implementation of Ruby (CRuby) does have a GIL (GVL).
<havenwood>
_sfiguser: JRuby, TruffleRuby and some other implementations don't have a GIL.
xco has joined #ruby
fphilipe has quit [Quit: WeeChat 2.4]
<havenwood>
_sfiguser: The CRuby path forward on that front appears to be the introduction of Guilds in Ruby 3 for parallel computation, and Async I/O backed by Fibers for parallel IO.
deepredsky has quit [Ping timeout: 258 seconds]
<_sfiguser>
what's a module to do async http requests in ruby ?
<leftylink>
out of curiosity I also looked at rubinius. then I saw its readme says it doesn't supprot refinements. guess I can't use it then, DOH
<havenwood>
_sfiguser: Check out the socketry async libraries, including the async gem: https://github.com/socketry