<zenspider>
the output will differ ... it isn't deterministic
<S1kx>
is there a way to get a stacktrace with hints to the ruby code?
<zenspider>
run in a debugger...
headius has joined #ruby-lang
macmartine has joined #ruby-lang
gnufied1 has quit [Quit: Leaving.]
gnufied1 has joined #ruby-lang
gnufied1 has quit [Client Quit]
gnufied has joined #ruby-lang
<gnufied>
is ruby built with debug symbols though?
<postmodern>
S1kx, first off you want to compile ruby with debugging symbols enabled
<postmodern>
S1kx, also you can `require 'debug'` to get a classical debugger
<gnufied>
I don't think ruby debugger will help here
<postmodern>
gnufied, maybe will just to step through?
<postmodern>
S1kx, also what kind of project is spinning up 100 threads
<S1kx>
would be quite some stepping through to get to the point, there's some heavy processing going on and it only occurs after around 5 minutes and dozens of requests/threads
justinseiter has quit [Ping timeout: 245 seconds]
<S1kx>
just URL/HTTP processing
<gnufied>
can you reproduce is locally or dev environment?
<S1kx>
yes sure
<gnufied>
also, please upgrade to 1.9.3 latest release. 1.9.3 is totally compatible with 1.9.2
<S1kx>
oh I have, i have only installed 1.9.2 too to test if the problem was already there
<gnufied>
okay.
<S1kx>
i will compile it with debugging symbols
<gnufied>
then you need to build a debug symbols enabled ruby
slyphon has quit [Quit: slyphon]
<gnufied>
usually passing debugflags="-g3 -gdb" to ./configure should do the trick
<gnufied>
I am used to using:
<gnufied>
./configure --enable-shared \
<gnufied>
--disable-install-doc optflags="-O0" \
<gnufied>
debugflags="-g3 -gdb"
<gnufied>
possibly if an extension which is causing the problem, you may have to compile extension with debugging enabled as well.
justinseiter has joined #ruby-lang
<gnufied>
but if what you are seeing is a threading problem, it is going to be hard to debug anyways
<gnufied>
:-)
blazes816 has joined #ruby-lang
<S1kx>
thanks
<S1kx>
I highly suspect it will have something to do with sqlite... am recoding this to have a broker process that puts the data into redis too
lcdhoffman has quit [Quit: lcdhoffman]
rins has joined #ruby-lang
agarie has quit [Remote host closed the connection]
headius has quit [Quit: headius]
sush24 has quit [Quit: Leaving]
martamccasland has quit [Ping timeout: 248 seconds]
mercwithamouth has quit [Ping timeout: 260 seconds]
Sinestro has joined #ruby-lang
mistym has quit [Remote host closed the connection]
gnufied has quit [Quit: Leaving.]
kogent has joined #ruby-lang
nettsundere has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
soypirate has quit [Remote host closed the connection]
justinseiter has quit [Remote host closed the connection]
gnufied has joined #ruby-lang
headius has joined #ruby-lang
headius has quit [Client Quit]
__BigO___ has quit [Remote host closed the connection]
davidbalber|away is now known as davidbalbert
bluepojo has quit [Ping timeout: 252 seconds]
kogent has quit [Quit: kogent]
blahwoop has joined #ruby-lang
davidbalbert is now known as davidbalber|away
bzb has joined #ruby-lang
_Sketch_ has quit [Read error: Connection reset by peer]
_Sketch_ has joined #ruby-lang
erichmenge_ has joined #ruby-lang
erichmenge has quit [Quit: Arrivederci!]
erichmenge_ is now known as erichmenge
dhruvasagar has joined #ruby-lang
<bzb>
Problem installing activerecord-mysql-adapter with MRI ruby 1.9.3-p362...details @ http://pastebin.com/MahMQP50
Rarrikins has quit [Ping timeout: 264 seconds]
bzalasky has quit [Remote host closed the connection]
karasawa has joined #ruby-lang
macmartine has quit [Quit: Computer has gone to sleep.]
waffleau_ has joined #ruby-lang
xalei has joined #ruby-lang
rins has quit [Ping timeout: 252 seconds]
qmx is now known as qmx|away
gnufied has quit [Quit: Leaving.]
Fretta has quit [Quit: Fretta]
xalei has quit [Remote host closed the connection]
io_syl has joined #ruby-lang
io_syl has quit [Client Quit]
wyhaines has joined #ruby-lang
io_syl has joined #ruby-lang
mjio has quit []
gnufied has joined #ruby-lang
unlikely_monkey has quit [Remote host closed the connection]
waffleau_ has quit [Quit: waffleau_]
<gnufied>
bzb: solved?
<gnufied>
you just need mysql client libraries
karasawa has quit [Ping timeout: 276 seconds]
klebervirgilio has quit [Remote host closed the connection]
klebervirgilio has joined #ruby-lang
<bzb>
gnufied: does that mean I need to install mysql client libraries and recompile ruby again?
<gnufied>
no. you need to install the client libraries and install mysql gem again
<gnufied>
which platform you are on? Ubuntu?
glebm has quit [Quit: Computer has gone to sleep.]
<zenspider>
and honestly, that doesn't clarify things for me... bewildering
ryanf has joined #ruby-lang
<zenspider>
I want `git nuke origin/master` to strip everything down to what you'd get if you re-cloned
<Silex>
zenspider: you're saying git log --graph displays origin/master at a different place than git log origin/master is?
<Spaceghost|cloud>
Silex: No, I was asking you. zenspider could have answered I guess.
<Silex>
zenspider: I'd try git fetch --all first to make sure the remotes are up to date
antbody has joined #ruby-lang
<zenspider>
everything is up to date
gregmoreno has joined #ruby-lang
<Paradox>
i made an egg salad sandwich
<Paradox>
erm
<Paradox>
nvm
<Silex>
Spaceghost|cloud: I'm not sure to understand the question then... magit just uses git and has a custom rebasing mechanism that can make magit display weird thing if you fucked up magit in the middle of it
<Silex>
erasing the custom magit file inside the .git directory fixes it
<Silex>
zenspider: I don't understand the problem then... does git log --graph --all display origin/master at the right place?
klebervi_ has quit [Remote host closed the connection]
retro|cz has quit [Ping timeout: 248 seconds]
diegoviola has joined #ruby-lang
jxie has quit [Quit: leaving]
ryanf has quit [Quit: leaving]
rue|w has joined #ruby-lang
Nisstyre has quit [Ping timeout: 248 seconds]
<chekcmate>
does inotify not register symbolic links??
oreoshake has quit [Read error: Connection reset by peer]
<chekcmate>
IN_ONLYDIR ensures that the event occur only on a directory. If you create such watch on a file it will not emit events. IN_DONT_FOLLOW forbids following symbolic links (these ones will be monitored themselves and not the files they point to).
<chekcmate>
alright...
oreoshake has joined #ruby-lang
waffleau has quit [Quit: waffleau]
* zenspider
looks at channel name
* emocakes
looks at zenspider
<judofyr>
cakes!
pabs has quit [Ping timeout: 260 seconds]
pabs has joined #ruby-lang
intinig has quit [Ping timeout: 255 seconds]
<chekcmate>
is there a way of monitoring a directory AND its symlinks?
tonni has quit [Ping timeout: 256 seconds]
tonni has joined #ruby-lang
faces has joined #ruby-lang
Nisstyre has joined #ruby-lang
apod has joined #ruby-lang
vlad_starkov has joined #ruby-lang
<zenspider>
chekcmate: a symlink is just a file. you're monitoring it
<zenspider>
what you want is something that traverses the symlink
<chekcmate>
no
<chekcmate>
when I e.g. monitor any /proc/pid/fd directory
<chekcmate>
I won't get notified when there is change in this directory
<chekcmate>
because they're all symlinks, which is not supported by the gem I used
<chekcmate>
which is based on inotify
<heftig>
chekcmate: this might also be because the filesystem doesn't support inotify
<chekcmate>
hm?
<chekcmate>
that makes no sense to what I read
<chekcmate>
it works fine with other directories/non-symlinks
vlad_starkov has quit [Ping timeout: 246 seconds]
<chekcmate>
IN_DONT_FOLLOW (since Linux 2.6.15) Don't dereference pathname if it is a symbolic link.
<chekcmate>
^-- that's my problem I think
<heftig>
chekcmate: no, it's not
<chekcmate>
thought maybe someone knows an alternative to this (or am I completly wrong here?)
<chekcmate>
it's not?
<heftig>
/proc simply does not support inotify in the way you want
<chekcmate>
ah damnit
<chekcmate>
ok...
<chekcmate>
that's what you meant then
<chekcmate>
I thought you meant the whole filesystem
<chekcmate>
heftig: well, then let me modify my question: Is there a way of monitoring symlinks in /proc? hehe
<heftig>
what are you trying to achive?
<chekcmate>
I want to know which files are being used by a program (more or less)
<chekcmate>
well, that's part of it... in a nutshell
<heftig>
trace it?
<chekcmate>
?
<heftig>
man ptrace
<chekcmate>
is this usable in ruby?
<heftig>
not as such, no
<heftig>
you could IO.popen strace
<chekcmate>
but generally, my idea of using a listener won't work?
<chekcmate>
(at least at /proc that is?)
<heftig>
it won't
<heftig>
more specifically, strace -e open -p <pid>
waffleau has joined #ruby-lang
<chekcmate>
hu... strace looks good :)
waffleau has quit [Client Quit]
<gnufied>
well you can use lsof as well
<chekcmate>
heftig: using strace in ruby/processing the output is possible though, right?
<chekcmate>
lsof won't do
<gnufied>
you want realtime?
<chekcmate>
tried it, but lsof won't get EVERYTHING
<chekcmate>
yea, I simulated some file accesses and lsof did not get everything
<chekcmate>
I decided to go with "tell me when something changes" instead of permanently asking "did something change?"
<chekcmate>
(sorry for my explanation)
<heftig>
there's also fatrace
<chekcmate>
hm...
<heftig>
it'll need privileges, but will show you operations system-wide
<chekcmate>
can I specify the pid+childs?
<heftig>
no, you can just tell it to ignore single pids
<chekcmate>
ah ok
<chekcmate>
it's more or less for someone who has to "clean up" a program and wants to know which files are still being used by it and which aren't
<heftig>
that's basically voodoo
<heftig>
maybe the program has internal state that references files that aren't open, but shouldn't be deleted
<heftig>
you can't know that
<chekcmate>
well... he kinda started with lsof, but that won't do
<chekcmate>
heftig: um.. I think it works when analyzing /proc/pid/maps or smaps
<chekcmate>
brb 5min (sorry)
<heftig>
chekcmate: no, that just gets you mmaped files
sush24 has quit [Quit: This computer has gone to sleep]
ottbot has joined #ruby-lang
<chekcmate>
heftig: it's really only "which files are written/read" only - I made sure
apod has quit [Ping timeout: 260 seconds]
<chekcmate>
but thanks for giving me that hint with referenced files - did not think of it!
wallerdev has quit [Quit: wallerdev]
GarethAdams has joined #ruby-lang
Kreeki has joined #ruby-lang
karasawa has quit [Read error: Connection reset by peer]
retro|cz has joined #ruby-lang
<chekcmate>
heftig: Haha, wanna know the background to that task? Remember the time when it was faster filling files with data from a DB and process it in that file, instead of directly doing it on the DB?
karasawa has joined #ruby-lang
<chekcmate>
(yea, me neither) - but that's where those obsolete files come from haha.
<yorickpeterse>
I however fear I can't just upgrade to the latest version without spending a few hours fixing everything
<apeiros>
yorickpeterse: wtf?
<judofyr>
I 2nd apieros: WTF?
<judofyr>
10 times slower for regular method calls?
<yorickpeterse>
So it seems
<yorickpeterse>
It increases exponentially
<apeiros>
yorickpeterse: what does the profiler say?
<yorickpeterse>
Profiler?
<apeiros>
I mean, how can it even interfere with that?
<apeiros>
ruby -rprofile
<yorickpeterse>
lemme check
<apeiros>
(or actually better use ruby-prof)
<apeiros>
beware, -rprofile = ~100x slower (no joke)
Bearproof has joined #ruby-lang
<apeiros>
with ruby-prof, it's something around 2-5x slower iirc
<yorickpeterse>
meh, I'll crack open ruby-prof
Bearproof has left #ruby-lang [#ruby-lang]
<yorickpeterse>
tbh since there's a newer version I first want to try that
<yorickpeterse>
For all I know it's just some weird bug that has already been fixed
<yorickpeterse>
what the fuck, draper *requires* active model?
<yorickpeterse>
For a simple proxy system that seems like a massive overkill
__BigO__ has quit [Remote host closed the connection]
<yorickpeterse>
lol nope, still slow
<yorickpeterse>
where's klabnik when you need him
srbaker has quit [Quit: Computer has gone to sleep.]
kiyan has joined #ruby-lang
kiyan has left #ruby-lang [#ruby-lang]
banister`sleep has joined #ruby-lang
sailias has quit [Quit: Leaving.]
zmack_ has joined #ruby-lang
zmack has quit [Ping timeout: 252 seconds]
justinseiter has quit [Ping timeout: 272 seconds]
karasawa has quit [Ping timeout: 240 seconds]
justinseiter has joined #ruby-lang
martamccasland has quit [Quit: Leaving]
mistym has joined #ruby-lang
rue|w has quit [Read error: Connection reset by peer]
rue_XIW has joined #ruby-lang
qmx|away is now known as qmx
srbaker has joined #ruby-lang
<yorickpeterse>
found it!
<yorickpeterse>
Hash#assert_valid_keys is for some reason slow as balls
<yorickpeterse>
if I mock out the method call it saves me about a second
breakingthings has joined #ruby-lang
justinseiter has quit [Ping timeout: 272 seconds]
justinseiter has joined #ruby-lang
cored has quit [Ping timeout: 252 seconds]
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
_Sketch_ has quit [Read error: Connection reset by peer]
_Sketch_ has joined #ruby-lang
Kreeki has quit [Quit: Leaving...]
scampbell has joined #ruby-lang
scampbell has quit [Max SendQ exceeded]
scottschecter has quit [Quit: WeeChat 0.3.9.2]
scottschecter has joined #ruby-lang
scampbell has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
unlikely_monkey has joined #ruby-lang
<tbuehlmann>
I'm testing a lib/gem with rspec and would like to alter behaviour depending on the environment. precisely, I want to disable a begin/rescue block (or reraise in it) if the environment is set to 'test' (or similar). how do ppl set their env for tests? using ENV?
sailias has joined #ruby-lang
unlikely_monkey has quit [Remote host closed the connection]
davidbalber|away is now known as davidbalbert
stardiviner has joined #ruby-lang
jonahR has joined #ruby-lang
<injekt>
tbuehlmann: anything test env dependent would just usually go into a test helper for example
<injekt>
tbuehlmann: otherwise, what other environment would you tests be run in
<tbuehlmann>
at the moment, I don't set any environment
MaddinXx_ has joined #ruby-lang
<injekt>
tbuehlmann: sure if you're running the tests, you environment would always be test?
<tbuehlmann>
hm?
Croms has joined #ruby-lang
<injekt>
oh, you want to check if it's in the test env from inside the lib?
<tbuehlmann>
no, just from inside the lib. I'm just unsure where and how to set it appropriatly. so, there where could be my spec_helper.rb, that's fine. and how? using a constant like ENV?
<injekt>
uh, maybe I'm missing something but i still have no idea what you're trying to do exactly
mistym has quit [Remote host closed the connection]
Croms has quit [Remote host closed the connection]
Croms has joined #ruby-lang
<tbuehlmann>
I want to set an environment variable somewhere to 'test' when running my tests, so I can alter some lib code (like `raise if ENV['LIBNAME_ENV'] == 'test'` in a begin/rescue block)
<tbuehlmann>
does rspec do that for me somewhere? and if not, how and where do people set it?
<injekt>
tbuehlmann: right, I would recommend against that and instead stub any code you need to inside your test helper
rdw200169 has joined #ruby-lang
jxie has quit [Quit: leaving]
<tbuehlmann>
ah
<injekt>
but I would also recommend against that, your tests should be testing the exact functionality of your code, your wouldn't be doing that
<tbuehlmann>
I'm testing some callback functionality and can't be sure if a callback raises somewhere, since it's being rescued. and so I can't tell if the callback itself even fired up. right now I'm testing this with `@called = true` in the spec at the end of the callback code and check for that
dustint has quit [Ping timeout: 245 seconds]
<tbuehlmann>
this works, but I'm unhappy with it since I cannot really say if something else is maybe going wrong inside the begin/rescue block
davidbalbert is now known as davidbalber|away
<tbuehlmann>
but stubbing or altering the code for the spec sounds good
ezkl has joined #ruby-lang
spinagon has joined #ruby-lang
davidbalber|away is now known as davidbalbert
Sinestro has joined #ruby-lang
rippa has quit [Ping timeout: 252 seconds]
dustint has joined #ruby-lang
<workmad3>
tbuehlmann: so you have some code, and you can't test if it's working correctly because of the way it's structured?
<workmad3>
tbuehlmann: I'd suggest writing some characterization tests, and then refactoring it until you can test it (without inserting test-specific code paths)
<tbuehlmann>
well, I actually can test it, but it feels not too clever. right now I don't know if a callback is raising an error, and I would like to change that
<tbuehlmann>
I could simply put the begin/rescue block into its own method and stub that, that'd do it
skitfish has joined #ruby-lang
<skitfish>
Hello, I have a quick question about Ruby arrays and '.empty?', if anyone's available and willing to assist.
<skitfish>
The condition in question is:
<skitfish>
if node['resolver']['nameservers'].empty? || node['resolver']['nameservers'][0].empty?
<skitfish>
This is from Chef, but I believe someone with Ruby experience can answer it. The question is why is the second part (after the '||') of the condition present?
Fretta has joined #ruby-lang
madcoder_ has quit [Read error: Connection reset by peer]
<injekt>
skitfish: the first checks if the 'nameservers' value is empty, and if its not it checks if the first object in that array is empty
dzhulk has joined #ruby-lang
<skitfish>
Thanks injekt. The next line in the code, which I downloaded from Opscode, warns that, nameservers is empty. If only the first index of the array is empty, then I wonder why the code warns about nameservers being empty.
<injekt>
skitfish: that's an OR condition, the second part isn't evaluated if the first part returns true
<injekt>
skitfish: so, it doesn't even check the first index of the array, because well.. it's empty
<skitfish>
That's fair enough, but what if the array were: [ "", "blah", "blah" ] ?
<injekt>
then that would indeed return true, for the second condition
waffleau_ has left #ruby-lang [#ruby-lang]
<skitfish>
Cool. Out of interest, have you used Chef before?
<ericwood>
only SwedishChef
<injekt>
skitfish: hardly
<ericwood>
but it has a tendency to borkborkbork ;)
<injekt>
skitfish: I would say so yes, the warning says it requires that the nameservers are set, but doesn't explicitly check that, so as you say.. ["", "foo", "bar"] would pass this. But I haven't any of the other code (which could strip stuff like this, who knows)
Fretta has quit [Remote host closed the connection]
dustint_ has quit [Client Quit]
chekcmate has quit [Quit: Page closed]
bantic has joined #ruby-lang
<skitfish>
OK, thanks injekt
<skitfish>
Appreciated.
dustint has quit [Quit: Leaving]
chekcmate has joined #ruby-lang
dustint has joined #ruby-lang
chekcmate has quit [Client Quit]
justinseiter has quit [Ping timeout: 272 seconds]
__BigO__ has joined #ruby-lang
justinseiter has joined #ruby-lang
blahwoop has joined #ruby-lang
adamjleonard has joined #ruby-lang
jxie has quit [Quit: leaving]
Sinestro has quit [Quit: Computer has gone to sleep.]
jxie has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
srbaker has joined #ruby-lang
carloslopes has joined #ruby-lang
maxmanders has joined #ruby-lang
wyhaines has joined #ruby-lang
jxie has quit [Quit: leaving]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
jxie has joined #ruby-lang
cba has joined #ruby-lang
methods has joined #ruby-lang
methods has quit [Read error: Connection reset by peer]
methods has joined #ruby-lang
karasawa has joined #ruby-lang
methods has left #ruby-lang [#ruby-lang]
gnufied has joined #ruby-lang
rue_XIW has quit [Read error: No route to host]
rue|w has joined #ruby-lang
flujan has joined #ruby-lang
<flujan>
s = "1,,2,3,4,5,,"
<flujan>
guys, for the s string above, how can I use split without eliminating the empty fields?
bantic has quit [Read error: Connection reset by peer]
<seydar>
j'ai des questions sur coolline mais je voudrais en discuter en francais
MaddinXx_ has quit [Remote host closed the connection]
io_syl has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
justinram has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
v0lta has quit [Remote host closed the connection]
dmwuw has joined #ruby-lang
wallerdev has joined #ruby-lang
dmwuw has quit [Remote host closed the connection]
Bearproof has joined #ruby-lang
TvL2386 has joined #ruby-lang
andrewhl has joined #ruby-lang
maxmanders has joined #ruby-lang
gnufied has joined #ruby-lang
zarubin has quit [Ping timeout: 248 seconds]
<TvL2386>
hi guys, I am developing a gem that requires json and must work on 1.8.7, 1.9.2 & 1.9.3. 1.8.7 has no built in json and requires to be dependent on the json gem. But 1.9.2 & 1.9.3 have built-in json support. How do you handle this developing a new gem?
zarubin has joined #ruby-lang
mercwithamouth has joined #ruby-lang
agarcia has quit [Quit: Konversation terminated!]
sulo has joined #ruby-lang
socialcoder has joined #ruby-lang
<socialcoder>
how to find the ASCII value of a particular character in ruby
<manveru>
TvL2386: just put the dependency in the gemspec with an if for that version?
tdy_ has quit [Quit: WeeChat 0.3.9.2]
tdy has joined #ruby-lang
<manveru>
or push two gems with different required_ruby_version
davidbalbert is now known as davidbalber|away
<mistym>
socialcoder: ASCII characters take up the first 7 bits of an 8 bit byte. string#unpack interprets a character as bianry data and converts it into an array of integers representing the string's values. So chr.unpack('C') is interpreting chr as an 8-bit unsigned char and printing out its integer value, which equates to its ASCII value for a character that exists within ASCII.
justinram has quit [Remote host closed the connection]
<mistym>
s/printing out/returning/
<apeiros>
also chr.ord
<apeiros>
chr.ord(encoding) if it's a non-ascii/non-binary
<TvL2386>
manveru, tyvm!
<mistym>
apeiros: Yeah, that's easier than unpack actually.
<apeiros>
hu, wait… ord(encoding) doesn't work?
<apeiros>
ah, other way round
<apeiros>
chr(encoding)
Kreeki has quit [Quit: Leaving...]
<apeiros>
but with ord, encoding is already available via String#encoding
<cored>
well that will imply I will have to change travis and my lib is a dependency of another application which is not migrated to 1.9.3 yet, but I'm guessing the transaction should be smooth
<cored>
right
<cored>
?
<havenn>
cored: should be just a few rvm commands to install 1.9.3-head and get gems updated, i'd think