arthurl

Activity Graph

Page 1 of 2 | Next »

2017-07-22

[14:43:57] arthurl: has joined #ruby
[14:50:50] arthurl: hi guys- is it possible to sort a hash in ruby?
[15:22:49] arthurl: havenwood disclaimer: I'm not a dev (clearly)- but I feel like i've tried everything
[15:26:19] arthurl: havenwood this is what my code and output looks like thus far
[15:26:20] arthurl: https://gist.github.com/alyssenko/168feee33a2d7bf0d8680dcfd186668b
[15:26:55] arthurl: and here is the aws doc on the structure http://docs.aws.amazon.com/sdkforruby/api/Aws/RDS/DBSnapshot.html
[15:27:22] arthurl: http://docs.aws.amazon.com/sdkforruby/api/Aws/RDS/Client.html#describe_db_snapshots-instance_method
[15:28:01] arthurl: i'd like to sort by snapshot_create_time so i can get the most recent snapshot
[15:34:08] arthurl: havenwood according to the AWS docs it's a 'Time' data type
[15:35:19] arthurl: `parse': can't convert Time into String (TypeError)
[15:37:42] arthurl: havenwood it looks like '2017-07-18 06:10:49 UTC'
[15:44:46] arthurl: havenwood i'm not sure what i'm looking at :)
[15:45:20] arthurl: so i take it DateTime.strptime is the format i want
[15:48:18] arthurl: right- i think i'm following- just trying to figure out how to tie it back with 'my_hash.db_snapshots.min_by { |db_snapshot| Date.parse db_snapshot.create_time }.last'
[15:51:38] arthurl: i was close :)
[15:51:40] arthurl: hmm still seeing '`parse': can't convert Time into String (TypeError)'
[16:16:34] arthurl: havenwood yes sorry- i thought i said that earlier
[16:16:50] arthurl: 'according to the AWS docs it's a 'Time' data type'
[16:18:12] arthurl: well it's still not clear to me on how i go about sorting it
[16:18:22] arthurl: my_hash.db_snapshots.min_by { |db_snapshot| Time db_snapshot.create_time }.last gives the same error
[16:21:26] arthurl: undefined method `last' for #<Aws::RDS::Types::DBSnapshot:0x007fe7cb3f3ff8> (NoMethodError)
[16:21:37] arthurl: trying 'p my_hash.db_snapshots.min_by(&:snapshot_create_time).last'
[16:25:34] arthurl: havenwood well i'm storing the response in a hash?
[16:25:46] arthurl: okay so 'p my_hash.db_snapshots.min_by(&:snapshot_create_time)' gives me the OLDEST
[16:26:07] arthurl: gives me what i need
[16:26:24] arthurl: i understand
[16:26:33] arthurl: that's easier said than done for someone like me :)
[16:26:37] arthurl: i appreciate your help sir
[18:29:59] arthurl: Quit: My MacBook has gone to sleep. ZZZzzz…

2017-06-01

[18:55:31] arthurl: has joined #ruby
[22:46:32] arthurl: Quit: My MacBook has gone to sleep. ZZZzzz…

2017-05-31

[19:01:24] arthurl: has joined #ruby
[19:04:24] arthurl: hi guys what does it mean if a jruby service bombs out with this error 'LoadError: no such file to load -- bundler/setup' but when i invoke the logic in the service definition file manually it works without issue?
[19:38:53] arthurl: havenwood bundler is definitely installed- as i said the app runs fine when invoke it directly (as opposed to using the service to start it)
[19:39:06] arthurl: to me it seems like some kind of scope issue
[19:40:26] arthurl: havenwood this is the service definition- https://gist.github.com/alyssenko/9aa447e633a157f17b9436352373a86b
[19:40:33] arthurl: if i run the code there manually it seems to work
[19:40:48] arthurl: when i invoke via /etc/init.d/service start that's when i get that strange bundler/setup error
[19:44:27] arthurl: havenwood i think you might be right about the GEM_PATH- i just added that echo line to the service definition and i see it was blank when i attempted to start the service
[19:50:28] arthurl: havenwood even after i explicitly defiined the GEM_PATH in the service definition it still fails with the same error (i see the echo statement is indeed outputting the correct GEM_PATH right before the daemon line is called)
[19:51:49] arthurl: havenwood the jruby_path is hardcoded in the service if you look so yes that should be ok
[19:52:05] arthurl: let me look into gem env and gempath
[19:56:46] arthurl: so printing gem env gempath
[19:56:51] arthurl: comes back with something weird from inside the service
[19:56:53] arthurl: '/.gem/ruby/1.8:/usr/lib64/ruby/gems/1.8'
[19:57:06] arthurl: and if i run it from my command line i get '/usr/local/rvm/gems/ruby-1.8.7-p374:/usr/local/rvm/gems/ruby-1.8.7-p374@global'
[20:02:00] arthurl: now i just need to figure out how to set it properly in the context of that service
[20:04:59] arthurl: havenwood it seems that my path already has that
[20:05:01] arthurl: echo $PATH /usr/local/rvm/gems/ruby-1.8.7-p374/bin:/usr/local/rvm/gems/ruby-1.8.7-p374@global/bin:/usr/local/rvm/rubies/ruby-1.8.7-p374/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/rvm/bin:/root/bin
[20:05:36] arthurl: havenwood yes
[20:07:08] arthurl: havenwood what's strange is that this is an ec2 instance, production, which also has a clone which we use for staging- and in staging it works
[20:08:20] arthurl: havenwood so i see the hardcoded jruby path we have in the service definition might actually NOT be the rvm one "JRUBY_PATH=/home/deploy/jruby-1.7.16/bin"
[20:09:22] arthurl: right, although i do also see 'jruby-1.7.15' listed when i run rvm list
[20:10:12] arthurl: well what's also interesting is that other server gem env gempath outputs what i want from inside the service
[20:10:20] arthurl: and everything looks identical
[20:10:46] arthurl: because we have other apps
[20:10:48] arthurl: that use it
[20:11:09] arthurl: yes, unfortunately
[20:13:51] arthurl: havenwood i appreciate the recommendation i think it was done this way for a reason- due to these old versions there was probably difficulty getting the jruby to play nice with rvm or something hence that standalone install
[22:21:03] arthurl: Ping timeout: 260 seconds

2017-05-01

[19:13:48] arthurl: has joined #ruby
[19:14:10] arthurl: hi guys- can someone help me understand what the problem is here? https://gist.github.com/alyssenko/731c6129c768e533a72fe1a22790a2d1
[19:19:11] arthurl: adam12 possibly- i'm just not sure how to debug in this case
[19:23:36] arthurl: adam12 let me try that
[19:39:24] arthurl: adam12 so the problem is with the gem binary itself
[19:39:31] arthurl: simply executing 'gem' results in the same error
[19:40:09] arthurl: adam12 correct
[19:46:51] arthurl: adam12 so it seems rubygems is broken right?
[19:47:06] arthurl: i have no idea how to debug or fix this issue- i'm def not a rubygems expert
[19:50:47] arthurl: thx adam12 yup the first command failed w/ the same error
[19:51:55] arthurl: thanks adam12 much appreciated
[19:52:03] arthurl: gonna give the manual uninstall a try
[19:52:30] arthurl: so now i get a different error
[19:52:42] arthurl: '/usr/local/rvm/gems/ruby-1.9.3-p551@global/gems/gem-wrappers-1.2.7/lib/rubygems_plugin.rb:11:in `require': cannot load such file -- gem-wrappers (LoadError)'
[23:04:26] arthurl: Ping timeout: 240 seconds

2017-03-31

[14:29:13] arthurl: has joined #ruby
[22:09:56] arthurl: Quit: My MacBook has gone to sleep. ZZZzzz…

2016-07-26

[20:28:28] arthurl: has joined #RubyOnRails
[22:33:09] arthurl: Ping timeout: 250 seconds

2016-07-22

[17:02:59] arthurl: has joined #ruby
[17:03:35] arthurl: hi guys- looking for advice on how to debug/isolate ruby code that causes a ruby application to hang around in an uninterruptible sleep state even those the application 'finishes' running
[17:04:51] arthurl: basically the code loads raw files into a database, upon doing so it spawns a 2 or 3 other ruby processes that do the work but when it's finished there's always one ruby process still present in the process list with a 'Sl' state
[17:07:17] arthurl: toretore i'm not a dev so i'm not really sure what the code is doing- but for what i can tell it's not an actual child process that gets left behind- it's the original parent process
[17:07:35] arthurl: i'm just an infra/devops guy trying to stand up this application in a new prod environment and i'm observing this behavior
[17:08:18] arthurl: but i do have the code base in front of me which i'm looking at trying to understand why this might be happening
[17:11:03] arthurl: unfortunately there are a lot of files in this application- plus not sure i can legally put this code up in a gist- sorry about that
[17:14:04] arthurl: toretore no i understand i guess my question was moreso is there a general approach that i could tkae
[17:14:18] arthurl: or if this was common with some ruby apps
[17:17:43] arthurl: toretore it always forks 3 other ruby instances- those finish and terminate
[17:19:02] arthurl: running from terminal yes
[17:19:06] arthurl: in foreground, correct
[17:19:34] arthurl: no it does
[17:19:36] arthurl: that's the thing
[17:19:43] arthurl: it executes, outputs, then returns
[17:19:46] arthurl: but when i do a px aux
[17:19:51] arthurl: i see it leaves behind a process
[17:20:25] arthurl: but i don't say it's a zombie because the state is 'Sl' uninterruptible sleep'
[17:20:31] arthurl: let me double check that
[17:22:30] arthurl: toretore you were right it's one of the other ones that get spawned
[17:22:32] arthurl: that gets left behind
[17:22:35] arthurl: not the original pid
[17:25:28] arthurl: so what's interesting is to my knowledge this same exact application runs on a different host without issue- meaning it doesn't leave any processes behind after it finishes- however it's ran through a crontask on that host
[17:27:41] arthurl: i'm wondering if this is actually by design and if it eventually would terminate itself
[17:27:46] arthurl: maybe some sleep/wait thing going on
[17:33:35] arthurl: drbrain strace is a good idea- thx
[17:49:43] arthurl: toretore so here is some of the code- i THINK that top function (process_retry) is where the forking is happening?
[17:49:44] arthurl: https://gist.github.com/alyssenko/94e5cc4a985b285b828f93cca3e89532
[17:50:35] arthurl: so basically if the application fails to find a file for a given country for a given provider it puts that provider/country combo into a retry array which forks this process
[17:52:51] arthurl: drbrain right- that's what i'm thinking too- just trying to understand the code
[18:20:19] arthurl: drbrain hmm let me see about that
[22:57:47] arthurl: Ping timeout: 260 seconds

2016-07-19

[16:45:02] arthurl: has joined #RubyOnRails
[16:45:11] arthurl: Mirubiri so the solution was easy..
[16:45:23] arthurl: nvm he's not here :)
[23:19:18] arthurl: Ping timeout: 250 seconds

2016-07-18

[14:24:16] arthurl: has joined #RubyOnRails
[15:09:07] arthurl: hi guys- is anyone here familiar with rack spec and or Rack::Lint ?
[15:09:44] arthurl: I'm seeing a 'Rack::Lint::LintError at / No Content-Type header found' error when running an application in 'production' mode- same app works just fine in 'development' mode
[15:14:06] arthurl: matthewd I guess I need to figure out how to look at the response
[15:15:16] arthurl: it's being served up by nginx so i'd think the content-type stuff is being handled correctly
[15:18:18] arthurl: matthewd yes it's a rails app
[15:19:51] arthurl: I'm the devops/infra guy responsible for standing this app up- using RAILS_ENV=development it comes up without an issue i guess that's why it's a little surprising to me that RAILS_ENV=production would behave differently with respect to content-types etc
[15:20:48] arthurl: matthewd I can try to remove Rack::Lint to see what happens?
[15:21:17] arthurl: this is an application that we purchased- and we basically don't have support from original developers- so maybe Rack::Lint isn't really needed here?
[15:22:40] arthurl: I'm not adding it myself, no
[15:40:10] arthurl: trying to figure out how i can go about testing the actual response from the application as opposed to the response that nginx gives me
[15:47:29] arthurl: matthewd here is the stracktrace- not sure if that helps https://gist.github.com/alyssenko/cf76fe4e0042d6f48b3e77532b8eb34a
[15:54:33] arthurl: matthewd it is though
[19:27:05] arthurl: has joined #ruby
[19:27:20] arthurl: is anyone here familiar with the following error? '/usr/bin/env: ruby_executable_hooks: No such file or directory'
[19:27:28] arthurl: seeing this when attempting to do a bundle install
[21:03:17] arthurl: is anyone here familiar with the following error? '/usr/bin/env: ruby_executable_hooks: No such file or directory'
[21:03:23] arthurl: seeing this when attempting to do a bundle install
[21:07:56] arthurl: Mirubiri I'm using rvm
[21:09:02] arthurl: Mirubiri thanks- I can try that. it's strange because it's happening only when i deploy via capistrano
[21:09:08] arthurl: locally i'm able to bundle install etc
[21:09:19] arthurl: so i'll have to add that gem regenrate_binstubs into the deploy logic
[21:12:04] arthurl: Mirubiri thanks- I'll give it a try
[21:23:01] arthurl: Mirubiri Unknown command regenerate_binstubs
[21:23:16] arthurl: I'm on rubygems 1.8.23
[21:26:59] arthurl: Mirubiri I take that back- 'gem regenerate_binstubs' worked as a non-root user
[21:27:18] arthurl: i see 'bundle' and 'bundler' point to different locations for root user and for deploy user (user which cap script is running as)
[21:31:25] arthurl: Mirubiri I was able to run 'rvm @global do gem regenerate_binstubs' unfortunately the deploy still fails with the same '/usr/bin/env: ruby_executable_hooks: No such file or directory' error
[21:41:21] arthurl: Mirubiri nope bundler 1.6.2 all around
[21:41:38] arthurl: i appreciate your help- yeah i'm stumped
[21:41:47] arthurl: i did see this however http://stackoverflow.com/questions/26247926/how-to-solve-usr-bin-env-ruby-executable-hooks-no-such-file-or-directory
[21:42:17] arthurl: i'm just not sure if that top answer is something i can even try since it's just failing on a bundle install
[21:44:18] arthurl: for some reason i think it may have to do with the fact that i did a single user install of rvm
[21:44:21] arthurl: for the deploy user
[21:44:25] arthurl: i see root user doesn't have rvm
[21:47:25] arthurl: Mirubiri yup 2.1.2p95
[21:47:40] arthurl: well root has a different ruby version that deploy user
[21:47:58] arthurl: i should probably just make sure root and deploy user are the same all across the board even though it shouldn't matter
[21:48:29] arthurl: it does but again the deploy is being executed as 'deploy' user
[21:51:08] arthurl: what do you mean?
[21:51:58] arthurl: oh yes- sorry, the user is named 'deploy'
[21:52:59] arthurl: wow- so i was able to reproduce by running the 'bundle install .......' command as root user, so it seems to me it is after all trying to run this code as root for some strange reason
[21:53:45] arthurl: the issue seems to be the fact that the cap script is executing the code as root...
[21:53:56] arthurl: sorry about that, ugh
[21:55:46] arthurl: I appreciate your help your questions helped me realize it could be a discrepancy between the users (even thought it shouldn't matter) it clearly does in my case since something is wrong, i'm explicitly specifying the 'deploy' user in the cap script as i have done in many other scripts- and it's not getting picked up for whatever reason
[22:24:57] arthurl: Mirubiri you're definitely right- in a lot of cases the answer is under ones nose :)O
[22:51:47] arthurl: Mirubiri nope lol
[22:52:02] arthurl: so i took a look at the auth logs and the user that the cap script is connecting as IS indeed 'deploy' ....
[22:52:09] arthurl: so now im running the cap script in debug mode...
[22:52:19] arthurl: i think the issue might have to do with the user environment
[22:52:35] arthurl: and what gets loaded in the terminal vs when capistrano connects via ssh
[22:54:49] arthurl: Mirubiri so here is the actual output where the deploy fails
[22:55:17] arthurl: right after that- i went on the server myself, and as deploy user executed the same statement in that directory and received no errors....
[22:56:25] arthurl: nope i mean i ssh'd into the machine myself
[22:56:30] arthurl: and went into that release directory
[22:56:32] arthurl: as deploy user
[22:56:41] arthurl: and ran the bundle command without error
[22:57:00] arthurl: thinking it may have somehting to do with bashrc or bash_profile stuff
[22:57:37] arthurl: yeah i know... no i think you're right they should be
[23:02:22] arthurl: Mirubiri good find- i think you're onto something here...
[23:02:30] arthurl: by default non-login
[23:02:35] arthurl: and non-interactive
[23:06:09] arthurl: it's definitely a nice tool
[23:06:17] arthurl: still learning a lot about it myself (obviously)
[23:07:13] arthurl: so basically rvm isn't getting loaded
[23:07:17] arthurl: from what it seems like
[23:07:43] arthurl: this is an ubuntu 14.04 box i'm deploying to- its strange because this same deploy logic works without issue on other hosts (mostly centos 6.5)
[23:12:06] arthurl: slacker.... i have to learn rails period :)
[23:13:13] arthurl: Mirubiri thanks again for your help i'm logging off for the day- i think i should be able to get this resolved tomorrow morning- still not sure why it works with other deploys/hosts but it's definitely an issue relating to the non-login non-interactive shell and how it's not picking up rvm etc
[23:15:13] arthurl: i'll be on tomorrow :)
[23:15:17] arthurl: have a good day/night
[23:20:02] arthurl: Ping timeout: 272 seconds

2016-07-15

[22:50:58] arthurl: has joined #RubyOnRails
[22:51:00] arthurl: has joined #ruby
[22:52:48] arthurl: hi guys- trying to bring up a rails app in production mode- appear to be having some trouble with the asset pipeline- i'm able to bring up the app in development mode without issue- but this is what i see in production: https://gist.github.com/alyssenko/886c83d353629d5d55d486039213cfeb
[22:53:05] arthurl: any thoughts or input would be much appreciated- been looking into this for the past 3 hours
[23:17:41] arthurl: hi guys- trying to bring up a rails app in production mode- appear to be having some trouble with the asset pipeline- i'm able to bring up the app in development mode without issue- but this is what i see in production: https://gist.github.com/alyssenko/886c83d353629d5d55d486039213cfeb
[23:17:50] arthurl: any thoughts or input would be much appreciated- been looking into this for the past 3 hours
[23:21:30] arthurl: havenwood thank you sir- i tried asking there but didn't receive a response
[23:31:54] arthurl: Ping timeout: 276 seconds

2016-07-06

[19:21:53] arthurl: has joined #ruby
[19:23:09] arthurl: hi guys- trying to understand if this is valid ternary operator syntax
[19:23:13] arthurl: var = (Rails.env.production? or Rails.env.studio?) ? "https://www.test1.com" : "https://test2.com"
[19:24:19] arthurl: Papierkorb thank you sir
[19:26:48] arthurl: havenwood are you saying the parentheses here don't matter? and/or that I should be using || instead?
[19:29:54] arthurl: i see- so for what i'm trying to do that syntax is wrong after all
[19:31:04] arthurl: var = Rails.env.production? || Rails.env.studio? ? "https://www.test1.com" : "https://test2.com"
[19:31:39] arthurl: unless Rails.env.production? || Rails.env.studio?
[19:31:46] arthurl: cool thanks guys- i appreciate the help
[19:33:09] arthurl: havenwood thanks - I'm a backend/devops guy that's taking a stab at ruby/ror
[19:34:29] arthurl: havenwood yup on there as well- very rarely post on irc as i try to google things to the best of my ability but sometimes you guys are way faster :)
[20:21:38] arthurl: Braintree::Configuration.environment = Rails.env == "production" || Rails.env == "studio" ? :production : :sandbox
[20:21:52] arthurl: anything wrong w/ that syntax?
[20:27:56] arthurl: smathy thanks taking a look at the %w documentation now
[20:29:11] arthurl: can't hurt to know
[20:29:42] arthurl: i see- that's cleaner for sure
[20:30:05] arthurl: thank you- the actual devs might feel threatened though :)
[21:58:05] arthurl: why is it that my my 'irb' doesn't throw errors?
[21:58:23] arthurl: basically i'm just trying to write/test simple ruby code from irb on osx
[22:00:46] arthurl: i'd expect a shell to throw syntax errors?
[22:01:18] arthurl: well like anything "adfasdf"
[22:01:23] arthurl: after i press enter
[22:02:24] arthurl: ahh jhass that was it :)
[22:02:30] arthurl: rookie mistake..
[22:02:57] arthurl: toretore jhass was right- i somehow started an expression and didn't end it
[22:03:44] arthurl: you mean 004:0 to 005:1 for example?
[23:24:59] arthurl: Quit: My Mac has gone to sleep. ZZZzzz…

2016-06-30

[01:16:54] arthurl: has joined #RubyOnRails
[01:16:54] arthurl: has joined #ruby
[01:24:01] arthurl: Quit: My Mac has gone to sleep. ZZZzzz…
[01:26:22] arthurl: has joined #RubyOnRails
[01:26:22] arthurl: has joined #ruby
[02:10:27] arthurl: Quit: My Mac has gone to sleep. ZZZzzz…
[03:09:17] arthurl: has joined #RubyOnRails
[03:09:17] arthurl: has joined #ruby
[03:14:53] arthurl: Quit: My Mac has gone to sleep. ZZZzzz…

2016-06-29

[13:56:07] arthurl: has joined #RubyOnRails
[13:56:07] arthurl: has joined #ruby
[16:17:37] arthurl: Quit: My Mac has gone to sleep. ZZZzzz…
[16:30:00] arthurl: has joined #RubyOnRails
[16:30:00] arthurl: has joined #ruby
[23:07:13] arthurl: Ping timeout: 250 seconds