<Obsdark>
I am having issues installing RVM in windows, is there a comprehensive guide about how to do it?
<Obsdark>
because all the paths seems to show to use the linux machine
<Obsdark>
or, install a bunch of software than is not correctly installed or with version inconsistencies all arround
<Obsdark>
I am trying to run a project from the github but the thing first ask for a version of ruby, then for another one, and so on and so for and it doesn't seems to work, maybe i am reading the error wrong but idk
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz_ has quit [Ping timeout: 255 seconds]
<Obsdark>
Did any of you use Ruby on windows?
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz_ has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
jenrzzz_ has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
user71 has quit [Quit: Leaving]
otisolsen70 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
user71 has joined #ruby
graywolf has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
graywolf has quit [Client Quit]
<henk>
hi, is there a common idiom for reading a file’s content doing all sanity checks or catching everything that might go wrong? I’m currently aware of checking File.readable? and File.exists? and then reacting to whatever combination accordingly. but this surely has been done countless times before, so I’m assuming there is some kind of "standard" way to do that.
<henk>
context: I need to read a crypto key from a file. I want to catch the condition that the file does not exist, because then I will have to create a key and write it to that file. I also want to catch the condition that the file exists but cannot be read because then I (most likely) also won’t be able to write the created key into it. I currently have http://pastie.org/p/30cPiahVf2e8VCjMAoIQvo but
<henk>
I’m wondering if there is a more generic way available that catches these and possible other problems.
jenrzzz has joined #ruby
Linux_Kerio has joined #ruby
victori has quit [Ping timeout: 268 seconds]
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
graywolf has joined #ruby
jenrzzz has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz_ has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
nemesit has quit [Read error: Connection reset by peer]
szkl has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
otisolsen70 has quit [Quit: Leaving]
jenrzzz has joined #ruby
Thanzex has quit [*.net *.split]
Al2O3 has quit [*.net *.split]
johnjaye has quit [*.net *.split]
havenwood has quit [*.net *.split]
pounce has quit [*.net *.split]
meimei has quit [*.net *.split]
Manouchehri has quit [*.net *.split]
tweaks has quit [*.net *.split]
Liothen has quit [*.net *.split]
moo has quit [*.net *.split]
poems has quit [*.net *.split]
hramrach has quit [*.net *.split]
oz has quit [*.net *.split]
ule has quit [*.net *.split]
moo has joined #ruby
ox has joined #ruby
hramrach has joined #ruby
ule has joined #ruby
tweaks has joined #ruby
Manouchehri has joined #ruby
Liothen has joined #ruby
poems has joined #ruby
havenwood has joined #ruby
tsujp has quit [Ping timeout: 260 seconds]
tsujp has joined #ruby
Thanzex has joined #ruby
meimei has joined #ruby
pounce has joined #ruby
johnjaye has joined #ruby
Al2O3 has joined #ruby
bambanxx has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
donofrio has quit [Ping timeout: 252 seconds]
graywolf has quit [Quit: WeeChat 4.0.4]
bambanxx has joined #ruby
AndreYuhai has joined #ruby
<AndreYuhai>
We're running this to start the server "bundle exec puma -C config/puma.rb" Is there any way I could also get it to run with irb?
bambanxx has quit [Client Quit]
<AndreYuhai>
So that I could interact and run my stuff as well in irb shell
<[0x1eef_]>
henk: I think we discussed this before. You can 'rescue SystemCallError'. That will catch everything that could go wrong AFAIK.
<[0x1eef_]>
SystemCallError is the superclass of all Errno exceptions.
<[0x1eef_]>
'man read'. There's apparently a lot of error conditions.
vvn has quit [Quit: WeeChat 4.1.3]
<henk>
[0x1eef_]: mhm, yeah, but that’s not very specific. I was hoping for some existing wrapper that catches at least the most occuring problems and provides helpful output …
<[0x1eef_]>
I think Ruby has predicates for the common scenarios: File.exist?, File.readable?
<[0x1eef_]>
That's probably "good enough".
<henk>
yeah, I’m using them already. and yeah: probably good enough … I’m not good with the 80/20 rule and care too much about the 20 d-: even when the 80 isn’t finished yet …
<henk>
thank you
<[0x1eef_]>
If you want something that's airtight, then you can either rescue SystemCallError or specific Errno exceptions. That's the next level. I'm not aware of something else.
jenrzzz has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
<henk>
ack, thanks
<[0x1eef_]>
yw
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
victori has joined #ruby
graywolf has joined #ruby
victori has quit [Ping timeout: 272 seconds]
victori has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
graywolf has quit [Quit: WeeChat 4.0.4]
AndreYuhai has quit [Quit: leaving]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
user71 has quit [Remote host closed the connection]
jenrzzz has joined #ruby
user71 has joined #ruby
user71 has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
reset has joined #ruby
infinityfye has joined #ruby
_ht has joined #ruby
jenrzzz_ has joined #ruby
user71 has joined #ruby
crivic is now known as crivic-away
crivic-away has quit [Quit: crivic was here]
szkl has quit [Quit: Connection closed for inactivity]
pgib has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
user71 has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
Na_Klar has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
<Na_Klar>
I'm developing a ruby script for a raspberry pi zero and I use Thread.new(). which seems not to work as expected, the one thread does not throw any output. Didn't I consider that the zero just has one core? Is that related, or does that not affect Thread at all?
<[0x1eef_]>
Na_Klar: Are you sure the main thread doesn't exit first ? Usually you want to call Thread#join at some point.
<Na_Klar>
no, the main thread is blocked at a Queue.
<Na_Klar>
(in a loop)
<[0x1eef_]>
Another angle to investigate: does the thread raise an exception ? IIRC those are silent by default.
<Na_Klar>
when I run the threads alone each, they work as expected
<Na_Klar>
but when both run simultanously, the one (always the same) does not throw anything anymore.
<[0x1eef_]>
Looks like report_on_exception is true on 3.3 by default.
<Na_Klar>
(3.1 here)
jenrzzz has quit [Ping timeout: 255 seconds]
<[0x1eef_]>
Is the pi running Linux ? I wouldn't imagine it would be hardware related.
<Na_Klar>
sure, raspIOS, which is debian ofc
<[0x1eef_]>
Do you have exception handling setup in each thread ? That might be worth doing.
<Na_Klar>
on my laptop (debian, 4 cores) the script works as expected..
jenrzzz has joined #ruby
user71 has joined #ruby
<[0x1eef_]>
Maybe set $stdout.sync = true as well, to not buffer output.
<Na_Klar>
I have no exepction catching yet, but the scripts are still very simple. And each on it own works. and they do not communicate with each other. (yet)
<Na_Klar>
.. hm buffering .. but the other threads talks to stdout without any problems .. so I don't think its buffering related
<[0x1eef_]>
Exception handling might help, as well as making sure the main thread is not exiting early, buffering might mislead in that scenario, I can only suggest things that might help debug.
<Na_Klar>
sure that
<Na_Klar>
but you say: IT SHOULD WORK. right?
<[0x1eef_]>
It sounds like it :) I didn't see any code.
<[0x1eef_]>
It's my understanding that as long as it is Linux Ruby will use pthreads, and that should be the same across hardware as long as the OS is Linux. There might be something unique to raspIOS, I'm not sure.
<Na_Klar>
yeah, I see. ok, then I'll reduce the script till the problem might be obvious.
<[0x1eef_]>
I can't find a 'test' method. Maybe try: p [method(:test).owner, method(:test).source_location] to make sure it's the method you expect.
jenrzzz has joined #ruby
<rapha>
it's part of minitest-rails afaik
<rapha>
oh ... the problem is something in my test_helper.rb's #initialize
<[0x1eef_]>
Roger. Mysterious error anyway. Probably should be something more obvious.
<rapha>
welcome to rails land :-/
<[0x1eef_]>
Lol
<rapha>
thanks for the nudge, [0x1eef_]
<[0x1eef_]>
No worries
<[0x1eef_]>
It seems like an error a type checker might catch.
<rapha>
who knows whats going on in there
<rapha>
now i'm stumbling over it not being possible to use seeds in tests
<rapha>
it's not like it used to be a few years back, though
<rapha>
running the tests does not _delete_ the test database contents
<rapha>
after the test you can RAILS_ENV=test rails c and check and the seeds are there alright
<rapha>
and i HAVE self.use_transactional_tests = false (although i don't think that's what's going on)
jenrzzz has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
<rapha>
ah, i can just not require rails/test_help.rb and be fine. rails and it's goddamn %$@#^@# "features"
<adam12>
Obsdark: Most people use RubyInstaller and not RVM on Windows.
<Obsdark>
intresting adam12, is there a way to change the active Ruby installation in windows using RubyInstaller?
<adam12>
rapha: Rails strips backtraces and makes exceptions super hard to follow. I hate it.
<adam12>
Obsdark: I'm not aware of one.
<Obsdark>
mostly asking because of the references when you work with a Ruby on Rails project
<Obsdark>
is there something like composer, or npm but for ruby?
<adam12>
Obsdark: Ruby+Windows is kind of a weird mixture, to be honest. You'll likely run into a multitude of problems. If you can use WSL (any version), it will likely be smoother sailing.
<adam12>
Ruby has Bundler.
<Obsdark>
WSL?
<adam12>
It's Linux for Windows.
<adam12>
If you can get RubyInstaller to install Ruby to separate paths, you could probably manipulate your PATH to force the version of Ruby that you want.
<adam12>
Na_Klar: I think there's a bug related to that on aarch64 only.
jenrzzz_ has quit [Ping timeout: 255 seconds]
<adam12>
I can't seem to find it tho.
<adam12>
Oh, it's Fiber not Thread.
jenrzzz_ has joined #ruby
donofrio has joined #ruby
otisolsen70 has joined #ruby
_ht has quit [Remote host closed the connection]
gramps has quit [Ping timeout: 255 seconds]
otisolsen70 has quit [Quit: Leaving]
bambanxx has joined #ruby
bambanxx has quit [Client Quit]
donofrio has quit [Read error: Connection reset by peer]
donofrio has joined #ruby
gramps has joined #ruby
Linux_Kerio has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
infernix has quit [Ping timeout: 264 seconds]
user71 has quit [Quit: Leaving]
infernix has joined #ruby
<Na_Klar>
I want to read from a named pipe continously and do smth when smth gets written into that pipe. I do a while loop on the pipe opened as a File. but after the first time smth was written into the pipe (and read by my script) the read obtains unlimited "nil" values. which leads to that the script eats the processor. so, why does the script reads nil after the first time smth was in the pipe and how do I avoid the load by reading them?
infernix has quit [Remote host closed the connection]
brokkoli_origina has quit [Ping timeout: 264 seconds]
brokkoli_origina has joined #ruby
ruby[bot] has quit [Remote host closed the connection]