<Haris>
You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
<jhass>
weird, bundle -v returns the old one then?
rwb has quit [Ping timeout: 276 seconds]
absolutejam2 has joined #ruby
cek has joined #ruby
<jhass>
maybe try bundle _2.0.2_ exec/install
<cek>
> 2.3 / 0.1
Haris has quit [Ping timeout: 240 seconds]
<cek>
>> 2.3 / 0.1
<ruby[bot]>
cek: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
queip has quit [Ping timeout: 252 seconds]
queip_ has joined #ruby
queip_ is now known as queip
<cek>
who's gonna tell me what's up with simple FP operations. No, I get the precision difficulties, but couldn't simple ops be optimized into Integer fields or something like that?
<jhass>
and behave different than any other language?
<jhass>
also probably a lot slower because it requires a couple of conversions rather than just going to the FPU directly
<cek>
`echo '2.3/0.1' | bc` is able to work it out
<cek>
not sure what's the scale used
<cek>
or are you suggesting my cpu's fpu is wrong? It can't have that big prec error on floats
<jhass>
so while 23.0 is a representable, given 0.23 is not 0.23 but someething close it it, it ends up being 22.99...
jenrzzz has quit [Ping timeout: 268 seconds]
drincruz_ has quit [Ping timeout: 240 seconds]
<jhass>
to make things worse in that example 0.1 is not even 0.1 either
al2o3-cr has quit [Ping timeout: 246 seconds]
queip_ has joined #ruby
queip has quit [Ping timeout: 252 seconds]
queip_ is now known as queip
Intelo_ has joined #ruby
rbruchal has joined #ruby
Intelo has quit [Ping timeout: 268 seconds]
<jhass>
a simple way out of this in case you have a specific precision that you need to adhere, say for example two digits in the case of money, a good strategy is to convert to integers by (float * 1e2).floor as early as possible after input and convert back with "%.2f" % (value / 1e2) as late as possible before output, where 2 is the precision in the examples
vondruch has quit [Ping timeout: 268 seconds]
<jhass>
usually you have a unit name you can use to make this more obvious. Dollars vs cents, Gram vs Nanogram etc
Technodrome has joined #ruby
schne1der has quit [Ping timeout: 268 seconds]
MinSrodowiska has quit [Quit: Bye Bye]
Intelo_ has quit [Quit: Leaving]
Intelo has joined #ruby
duderonomy has quit [Ping timeout: 268 seconds]
mossplix_ has quit [Remote host closed the connection]
mossplix has joined #ruby
greengriminal has joined #ruby
lucasb has joined #ruby
jenrzzz has joined #ruby
gnufied__ has joined #ruby
mossplix has quit [Ping timeout: 246 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MinSrodowiska has joined #ruby
Technodrome has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
mossplix has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.6]
al2o3-cr has joined #ruby
honigkuchen has joined #ruby
john2496 has joined #ruby
Jonopoly has joined #ruby
drincruz_ has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
<Intelo>
Hi
<Intelo>
Is there any bad effect doing RAILS_ENV=production bundle exec rails console on productin?
honigkuchen has quit [Ping timeout: 268 seconds]
<havenwood>
Intelo: Nope, nothing bad there, depending on what you type in the console of course.
<Intelo>
what can be typed that goes bad?
<havenwood>
Intelo: From the console you can nuke all your data, etc.
<havenwood>
Intelo: You might consider running in sandbox mode to rollback database modifications when you leave console.
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
Intelo: That ^ doing the same thing, using Rails' binstub and option flags.
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
<Intelo>
hm
Technodrome has joined #ruby
<Intelo>
where can I learn all the rails stuff/
<havenwood>
Intelo: I'd go through the Rails documentation first, since it's nicely done.
<Intelo>
hm
<havenwood>
Then either grab a book that digs deeper or start working or pairing on a Rails app.
jbeaudoin_sher has joined #ruby
<havenwood>
(I guess you're already working on one, so on the path!)
schne1der has joined #ruby
<Intelo>
thanks
mossplix has quit [Ping timeout: 250 seconds]
Intelo has quit [Ping timeout: 276 seconds]
etupat has joined #ruby
zone_31 has quit [Quit: WeeChat 2.5]
poontangmessiah has joined #ruby
jeremycw has joined #ruby
duderonomy has joined #ruby
mossplix has joined #ruby
akemhp_ has joined #ruby
Esa_ has joined #ruby
edwardly has quit [Read error: Connection reset by peer]
eljimmy has joined #ruby
akem__ has quit [Ping timeout: 240 seconds]
skx86 has joined #ruby
MinSrodowiska has quit [Quit: Bye Bye]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
kyrylo has joined #ruby
jenrzzz has joined #ruby
Intelo has joined #ruby
quazimodo has quit [Ping timeout: 265 seconds]
conta2 has joined #ruby
queip has quit [Ping timeout: 268 seconds]
etupat has quit [Remote host closed the connection]
quazimodo has joined #ruby
queip_ has joined #ruby
queip_ is now known as queip
jenrzzz has quit [Ping timeout: 240 seconds]
etupat has joined #ruby
Intelo has quit [Remote host closed the connection]
BH23 has joined #ruby
etupat has quit [Remote host closed the connection]
absolutejam2 has quit [Ping timeout: 246 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
duderonomy has quit [Ping timeout: 268 seconds]
etupat has joined #ruby
poontangmessiah has quit [Remote host closed the connection]
pdub has joined #ruby
pdub has quit [Remote host closed the connection]
pdub has joined #ruby
ctOS has joined #ruby
etupat has quit [Ping timeout: 268 seconds]
<ctOS>
Hi. I’m looking at a Heisenbug. Any idea why a file could trigger an Errno::ENOENT from File.mtime when executed right after File.exists that returns true? The file in question is a file that doesn’t chage, move, and isn’t modified in any way. It just sits there. Bug goes away when testing with strace, of course.
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs has quit [Ping timeout: 276 seconds]
ellcs has joined #ruby
sylario has joined #ruby
jenrzzz has joined #ruby
<havenwood>
ctOS: why the #to_s for one and not the other?
TomyWork has quit [Remote host closed the connection]
<ctOS>
havenwood: I have no idea. that’s in Rake and not my code. I’ve tried removing the .to_s but it makes no difference.
<adam12>
ctOS: What OS and filesystem? Is it a network filesystem?
greengriminal has joined #ruby
<ctOS>
adam12: linux, ext4, all local
ellcs has quit [Ping timeout: 265 seconds]
Ai9zO5AP has joined #ruby
<ctOS>
my Rakefile contains Rake::FileList["src/*.md"], right. Running `strace rake` and it always works. Running just `rake` ad it fails almost every time with Errno::ENOENT inside rake on line 23 as linked above.
<adam12>
ctOS: Ruby version? It's definitely an odd bug.
<ctOS>
It fails less often with `rake --trace`, which to me suggests a timing issue.
<adam12>
ctOS: My only other idea would be to build that version of ruby from source and see if it's the same. Maybe it's a patch from the vendor that we don't know about?
andikr has quit [Remote host closed the connection]
<adam12>
ctOS: Well I'm miffed.
hutch has joined #ruby
BH23 has quit [Ping timeout: 265 seconds]
drincruz_ is now known as drincruz
<ctOS>
I modified line 24 from File.exists?(name) to File.exists?(name)&&File.mtime(name). It still fails on line 23. All that happens there is File.mtime(name).
<ctOS>
Thanks for all your help guys. Looks like what I need is an exorcist
mossplix has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 268 seconds]
brandoncc has joined #ruby
BH23 has joined #ruby
Jonopoly has quit [Quit: WeeChat 2.5]
<ctOS>
havenwood: I looped `rake` 500 times with that code and everything worked just fine. No weird errors about missing files. I suspect Rake won’t accept it as a patch, though.
hutch has joined #ruby
<adam12>
ctOS: How many files match that src/*.md glob? Lots?
<havenwood>
From `man 2 stat`: ENOENT A component of pathname does not exist or is a dangling symbolic link.
<ctOS>
This all happens in the middle of Rake::FileList['src/*.md']. It checks like 50 files in the src/ directory and then fails on a random file.
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4351 is now known as AJA4350
<havenwood>
ctOS: Any symbolic links involved?
<ctOS>
havenwood: none whatsoever. no weirdness with moving files, renaming things, deleting and recreating, or anything like that.
honigkuchen has joined #ruby
queip has quit [Ping timeout: 246 seconds]
queip_ has joined #ruby
<ctOS>
The src/ dir just contains some static text files.
queip_ is now known as queip
<ctOS>
I’ve looped over `rake` 500 times now. It fails 80% of the time. I’ve got no idea why it works 20% of the time. It works 100% of the time if I run `strace rake`. `strace` shouldn’t have any effect other than possibly delaying the I/O a bit.
<ctOS>
it fails 45% of the time when running with `rake --trace`. Not sure what trace does here other than delaying things fractionally as it prints more to stdout.
pb122 has joined #ruby
BH23 has quit [Ping timeout: 250 seconds]
BH23 has joined #ruby
pb122_2 has quit [Ping timeout: 264 seconds]
dionysus69 has quit [Ping timeout: 265 seconds]
etupat has joined #ruby
mre- has quit [Ping timeout: 264 seconds]
NL3limin4t0r is now known as NL3limin4t0r_afk
mossplix has joined #ruby
GodFather has quit [Ping timeout: 268 seconds]
Spitfire has joined #ruby
Spitfire has quit [Changing host]
Spitfire has joined #ruby
davor has quit [Quit: Bye]
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
davor has joined #ruby
mossplix has quit [Remote host closed the connection]
suukim has joined #ruby
akem__ has joined #ruby
akemhp_ has quit [Ping timeout: 250 seconds]
<ytti>
ctOS, this is not uncommon
<ytti>
ctOS, you have some race condition
jacksoow has joined #ruby
hutch has quit [Ping timeout: 252 seconds]
jacksoow_ has quit [Ping timeout: 252 seconds]
jacksoow has quit [Read error: Connection reset by peer]
<ytti>
ctOS, even the strace fixes is very common
<ytti>
frustrading, but common
<ctOS>
ytti: it’s probably a race-condition but I don’t even know who the contestants are
<ytti>
ctOS, might even be kernel issue
jacksoow has joined #ruby
<ctOS>
ytti: that seems more and more likely. I moved everything to an USB HDD (to introduce more latency) and it works just fine. An nvme m2 ssd may not have been a good investment after all.
phaul has joined #ruby
<ytti>
i once had freebsd kernel issue causing ruby to break with some socket stuff
<ytti>
but at least it broke deterministically
<ytti>
so was far easier to troubleshoot
<ytti>
those 'oh strace fixed it' issues are infuriating
SeepingN has joined #ruby
AJA4350 has quit [Ping timeout: 264 seconds]
etupat has quit [Remote host closed the connection]
jacksoow has quit [Read error: Connection reset by peer]
etupat has quit [Remote host closed the connection]
FastJack has joined #ruby
lxsameer has quit [Quit: out]
cek has quit [Quit: Connection closed for inactivity]
conta2 has quit [Ping timeout: 240 seconds]
etupat has joined #ruby
jacksoow_ has joined #ruby
jacksoow has quit [Ping timeout: 240 seconds]
mossplix has joined #ruby
mre- has joined #ruby
akem__ is now known as akem
mre- has quit [Ping timeout: 240 seconds]
fphilipe has joined #ruby
dionysus69 has joined #ruby
psilly0 has joined #ruby
rbruchal has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
rbruchal has joined #ruby
Guest11431 has joined #ruby
rafadc has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fphilipe has quit [Ping timeout: 252 seconds]
orbyt_ has joined #ruby
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
etupat has quit [Remote host closed the connection]
etupat has joined #ruby
mre- has joined #ruby
etupat has quit [Ping timeout: 246 seconds]
<ctOS>
Ok, "progress": The underlying problem seems to be that the working directory sometimes changes mid-function, and the files have relative paths
hutch has joined #ruby
poontangmessiah has joined #ruby
phaul has quit [Ping timeout: 268 seconds]
etupat has joined #ruby
fphilipe has joined #ruby
hutch has quit [Ping timeout: 276 seconds]
poontangmessiah_ has joined #ruby
poontangmessiah has quit [Ping timeout: 240 seconds]
<ctOS>
by mid-function, I mean that it’s changes from one puts to the other here: https://dpaste.de/nZwg
yann-kaelig has joined #ruby
stryek has joined #ruby
code_zombie has joined #ruby
psilly0 has quit [Quit: psilly0]
psilly0 has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
<ctOS>
Oh. The cwd is changed hundreds of times per minute looking for "gems.rb" and "Gemfile".
howdoi has joined #ruby
conta has joined #ruby
conta2 has joined #ruby
poontangmessiah_ has quit [Remote host closed the connection]
poontangmessiah_ has joined #ruby
wildtrees has joined #ruby
<ctOS>
FIXED!
<ctOS>
`touch Gemfile` in my project (creating an empty file) and the problem goes away completely.
conta has quit [Ping timeout: 245 seconds]
conta2 is now known as conta
quintasan has quit [Quit: quintasan]
quintasan has joined #ruby
quintasan has joined #ruby
quintasan has quit [Changing host]
<ctOS>
So, … uhm. In which project does this bug belong? What uses chdir ../ to look for Gemfiles?
Synthead has joined #ruby
<Synthead>
I want to use rubocop in a ruby script. Can I just require rubocop and run rubocop from class instances? seems a little silly to shell out, being that it's a ruby script
<ytti>
ctOS, i'd still be curious what the problem is
poontangmessiah_ has quit [Ping timeout: 268 seconds]