« Back to channel list

#RubyOnRails - 25 January 2019

« Back 1 day Forward 1 day »
[00:04:18] Xiti: has joined #RubyOnRails
[00:21:09] Tempesta: has joined #RubyOnRails
[01:00:26] tdy: has joined #RubyOnRails
[01:12:55] chouhoulis: has joined #RubyOnRails
[01:13:06] zandimna: has joined #RubyOnRails
[01:13:43] zandimna: so, my rails console broke since the ruby 2.6.0 release
[01:14:57] zandimna: https://dpaste.de/xpDR
[01:15:00] zandimna: here is the output
[01:15:23] zandimna: even for newly created apps
[01:15:32] zandimna: other commands work just fine though
[01:43:58] babykosh: has joined #RubyOnRails
[02:03:56] brandoncc: has joined #RubyOnRails
[02:24:45] havenwood: zandimna: It looks like this same issue with Bootsnap not finding IRB: https://github.com/Shopify/bootsnap/issues/223
[02:25:57] havenwood: zandimna: You might want to disable bootsnap until there's a fix or try clearing its cache manually.
[02:41:53] zandimna: so i disabled it now and it still doesn't work
[02:42:03] zandimna: and now the problem seems to be with activesupport
[02:43:33] zandimna: havenwood: https://dpaste.de/wdXW
[02:43:54] zandimna: i don't think that's something i can disable :\
[02:44:33] quazimodo: has joined #RubyOnRails
[02:45:19] havenwood: zandimna: Does IRB seem to otherwise be there? Does this return true?: ruby -e "p require 'irb'"
[02:45:52] zandimna: i just installed irb, but the error is still there
[02:45:56] zandimna: yes that returns ture
[02:51:27] havenwood: zandimna: I don't know why rails dep loader is borking for you. Same if you stop spring?
[02:51:57] zandimna: how do i do that?
[02:52:03] havenwood: zandimna: spring stop
[02:52:40] havenwood: bin/spring stop
[02:53:05] zandimna: nope it still doesn't start
[02:53:25] havenwood: zandimna: `bundle install` runs fine?
[02:53:51] havenwood: and same issue if you run console with: bin/rails console
[02:57:19] zandimna: everything else works fine (tests, server, db)
[03:02:40] havenwood: zandimna: I'm curious to see your $LOAD_PATH on line 291.
[03:19:56] chouhoulis: has joined #RubyOnRails
[03:20:01] zandimna: it's no set to anything i think
[03:21:00] zandimna: should it be set to something?
[03:40:18] ariedler: has joined #RubyOnRails
[03:47:15] brandoncc: has joined #RubyOnRails
[04:01:55] creamme: having a problem making a query with this setup https://dpaste.de/XRf1#
[04:02:44] creamme: I want to get a sum of volunteers for multiple meals grouped by organizations
[04:09:15] creamme: I love how asking a question clears in my head what I want enough that I find the answer!
[04:09:21] braincrash: has joined #RubyOnRails
[04:11:08] tdy: has joined #RubyOnRails
[04:26:58] brandoncc: has joined #RubyOnRails
[04:27:37] duderonomy: has joined #RubyOnRails
[04:43:04] NeXTSUN: has joined #RubyOnRails
[05:16:37] tdy: has joined #RubyOnRails
[05:22:22] Technodrome: has joined #RubyOnRails
[05:23:41] DoctorMonocular: I'm hitting weird behavior -- I have like h = Hash.new([]); and when I do h[:foo] I get a [] back like I want, but it doesn't stick if I do h[:foo] << 2
[05:23:52] DoctorMonocular: that returns [2], but the hash is unchanged
[05:24:06] DoctorMonocular: if I do h[:foo] = []
[05:24:09] DoctorMonocular: then it's there
[05:24:17] DoctorMonocular: but the default doesn't remain
[05:25:14] DoctorMonocular: I think I need to manually assign it in the hash.new block?
[05:27:30] DoctorMonocular: yeah, that was it
[05:27:39] DoctorMonocular: the hash block is responsible for actually persisting the thing
[05:27:50] havenwood: DoctorMonocular: Check the `h.default` value as you mutate that Array. It's just a single Array that's the default value for all keys.
[05:28:43] havenwood: DoctorMonocular: An alternative to a #default value is a #default_proc, which can return a new Array each time a new key is fetched.
[05:29:01] havenwood: DoctorMonocular: Hash.new { |h, k| h[k] = [] }
[05:29:38] havenwood: DoctorMonocular: Another way to set that same default proc is: h.default_proc = -> h, k { h[k] = [] }
[05:40:40] danguita: has joined #RubyOnRails
[05:41:27] ariedler: has joined #RubyOnRails
[06:16:17] Jervis_: has joined #RubyOnRails
[06:44:09] egray: has joined #RubyOnRails
[06:46:07] srinidhi: has joined #RubyOnRails
[07:04:48] eclm: has joined #RubyOnRails
[07:42:18] ariedler: has joined #RubyOnRails
[07:48:11] srinidhi: has joined #RubyOnRails
[07:53:13] dionysus69: has joined #RubyOnRails
[08:14:53] oddie: has joined #RubyOnRails
[08:18:46] wethu: has joined #RubyOnRails
[08:31:25] defsdoor: has joined #RubyOnRails
[08:42:31] eclm: has joined #RubyOnRails
[08:47:16] RiPuk: has joined #RubyOnRails
[09:20:54] mikecmpbll: has joined #RubyOnRails
[09:28:23] WhereIsMySpoon: has joined #RubyOnRails
[09:28:38] blackmesa: has joined #RubyOnRails
[09:29:03] WhereIsMySpoon: Hello - small question: how come if I have my two fields in my model as attr_accessor, they get saved to the model in the db fine, but if I have them as attr_writer they dont?
[09:30:06] WhereIsMySpoon: oh wait nvm - i thought attr_writer was going to define readers and writers and accessor was for reading
[09:38:07] Guest16678: has joined #RubyOnRails
[09:40:12] GodFather: has joined #RubyOnRails
[09:40:50] fox_mulder_cp: WhereIsMySpoon: why you need it? its a old school and for non AR model classes
[09:41:15] fox_mulder_cp: wher you define field rails create accessor/writer for it by design
[09:41:19] WhereIsMySpoon: fox_mulder_cp: wait, so i dont need to specify my fields at all?
[09:41:46] WhereIsMySpoon: in my model class
[09:42:00] fox_mulder_cp: WhereIsMySpoon: you don't need write accessor and writer
[09:42:11] WhereIsMySpoon: i changed writer to accessor
[09:42:25] WhereIsMySpoon: i confused myself thinking "writer" meant it would generate a reader and writer
[09:42:30] WhereIsMySpoon: i havent done ruby in a while :P
[09:43:06] ariedler: has joined #RubyOnRails
[09:43:39] fox_mulder_cp: https://guides.rubyonrails.org/active_model_basics.html
[09:43:45] fox_mulder_cp: https://launchacademy.com/codecabulary/learn-rails/writing-a-rails-model
[09:44:36] tuor: has joined #RubyOnRails
[09:48:37] gregf_: has joined #RubyOnRails
[10:08:19] blackmesa1: has joined #RubyOnRails
[10:50:32] ghormoon: has joined #RubyOnRails
[11:08:12] Ergo: has joined #RubyOnRails
[11:38:49] blackmesa1: has joined #RubyOnRails
[11:43:57] ariedler: has joined #RubyOnRails
[11:46:42] blackmesa1: has joined #RubyOnRails
[11:51:22] Leifr: has joined #RubyOnRails
[11:55:07] ariedler: has joined #RubyOnRails
[12:05:21] powerbit: has joined #RubyOnRails
[12:17:20] status402: has joined #RubyOnRails
[12:35:46] reber: has joined #RubyOnRails
[12:57:00] Guest16678: has joined #RubyOnRails
[13:04:08] Guest16678: has joined #RubyOnRails
[13:21:39] defsdoor: has joined #RubyOnRails
[13:30:18] lexileo: has joined #RubyOnRails
[13:34:49] ravenousmoose: has joined #RubyOnRails
[13:34:53] Guest16678: has joined #RubyOnRails
[13:46:23] pLaTo0n: has joined #RubyOnRails
[13:58:48] eclm: has joined #RubyOnRails
[14:00:39] _aeris: has joined #RubyOnRails
[14:01:52] WhereIsMySpoon: Hello - I've got a stupid simple controller + model setup, but for some reason my model attrs arent getting set into the db. Ive put the model + controller + response function in here https://gist.github.com/Jarob22/62e4beece5dd4e3e3473634ddc25b601 - what happens is my server responds with the model as it should be, ie with the reminder_text and reminder_date inside it, set, but those 2 attrs dont get put into the database. What
[14:01:52] WhereIsMySpoon: gives? Im sure it must be something stupid...
[14:02:36] WhereIsMySpoon: have updated the gist with the server console output
[14:04:30] WhereIsMySpoon: im probably doing something super dumb, i havent used rails for years
[14:04:59] tbuehlmann: reminder_text and reminder_date are table columns?
[14:05:22] WhereIsMySpoon: sqlite> select * from reminders;
[14:05:22] WhereIsMySpoon: id|reminder_text|reminder_date|created_at|updated_at
[14:05:22] WhereIsMySpoon: 1|||2019-01-25 13:58:31.343583|2019-01-25 13:58:31.343583
[14:05:34] tbuehlmann: great, remove that `attr_accessor :reminder_text, :reminder_date` and try again
[14:05:50] WhereIsMySpoon: i dont need the fields in the model at all?
[14:06:04] WhereIsMySpoon: thats..confusing
[14:06:16] WhereIsMySpoon: why does it break with the accessor there? am i overwriting an existing one?
[14:06:27] eclm: has joined #RubyOnRails
[14:06:39] tbuehlmann: exactly. rails will check the database tables for the columns and add methods on the model. you're overriding the methods here
[14:06:42] WhereIsMySpoon: now it works :D
[14:07:53] WhereIsMySpoon: thank you tbuehlmann
[14:08:20] tbuehlmann: you're welcome!
[14:08:23] WhereIsMySpoon: i knew it would be something stupid :P
[14:08:36] tbuehlmann: nah, it's an honest mistake
[14:08:38] WhereIsMySpoon: last time i used rails was uh...5 years ago
[14:14:35] tbuehlmann: great gist for debugging this issue, btw. it's not every day that we get such good information
[14:31:41] krawchyk: has joined #RubyOnRails
[15:06:27] ravenousmoose: has joined #RubyOnRails
[15:19:46] WhereIsMySpoon: tbuehlmann: i try to do that any time i have a problem :) as someone who does this for a living (not with rails!) i appreciate when i get good bug reports
[15:21:23] orbyt_: has joined #RubyOnRails
[15:23:16] ravenousmoose: has joined #RubyOnRails
[15:26:42] ryandv: has joined #RubyOnRails
[15:33:06] uks: has joined #RubyOnRails
[15:34:42] kidPalooma: has joined #RubyOnRails
[15:50:30] blackmesa1: has joined #RubyOnRails
[15:54:53] NeXTSUN: has joined #RubyOnRails
[15:56:59] ravenousmoose: has joined #RubyOnRails
[15:58:24] blackmesa1: has joined #RubyOnRails
[16:11:02] conta1: has joined #RubyOnRails
[16:12:36] blackmesa1: has joined #RubyOnRails
[16:24:23] conta1: has joined #RubyOnRails
[16:34:15] chouhoulis: has joined #RubyOnRails
[16:34:19] Saukk: has joined #RubyOnRails
[16:34:47] srinidhi: has joined #RubyOnRails
[16:34:55] chouhoulis: has joined #RubyOnRails
[16:51:31] ravenousmoose: has joined #RubyOnRails
[16:54:02] blackmesa1: has joined #RubyOnRails
[16:58:50] andrewray: has joined #RubyOnRails
[17:05:05] brandoncc: has joined #RubyOnRails
[17:09:13] ravenousmoose[aw: has joined #RubyOnRails
[17:14:33] ivanskie: has joined #RubyOnRails
[17:15:00] conta1: has joined #RubyOnRails
[17:16:30] ivanskie: any of you working with large RoR applications in production?
[17:16:49] ivanskie: How do you guys have logging setup?
[17:17:45] ivanskie: we've got lograge, errbit, newrelic.. but it looks like anything logged to Rails.logger.info is lost.
[17:17:52] ivanskie: and not logged anywhere
[17:18:26] ivanskie: too bad Shopify doesn't have their code up somewhere. or even just how their infra. and logging is setup
[17:18:53] ivanskie: oh nevermind found some articles
[17:29:34] Dbugger: has joined #RubyOnRails
[17:30:39] tdy: has joined #RubyOnRails
[17:31:15] ivanskie: aaah fridays, the quietest IRC day :)
[17:38:06] DoctorMonocular: has joined #RubyOnRails
[17:38:41] DoctorMonocular: ok rubyists, riddle me this -- what's the most concise way to invert a hash like this: https://gist.github.com/PeteMichaud/bc3ed6058841abd402eb6f1abd270344
[17:41:49] ravenousmoose[aw: has joined #RubyOnRails
[17:45:38] [Butch]: has joined #RubyOnRails
[17:52:23] Guest16678: has joined #RubyOnRails
[17:58:45] ravenousmoose[aw: has joined #RubyOnRails
[18:03:20] blackmesa1: has joined #RubyOnRails
[18:09:50] rikkipitt: has joined #RubyOnRails
[18:10:39] tdy: has joined #RubyOnRails
[18:11:22] rikkipitt: hey folks, i'm running into an issue where I can't catch an exception that is raised outside of the application layer - specifically OAuth::Unauthorized (e.g. when a user refresh_token has expired)
[18:11:42] rikkipitt: does anyone know of a way of catching such exceptions in the application layer?
[18:26:22] agent_white: has joined #RubyOnRails
[18:45:15] ryandv: has joined #RubyOnRails
[18:46:37] rikkipitt: has joined #RubyOnRails
[18:48:03] orbyt_: has joined #RubyOnRails
[18:56:16] chouhoulis: has joined #RubyOnRails
[19:00:40] reber: has joined #RubyOnRails
[19:16:21] lxsameer: has joined #RubyOnRails
[19:22:37] rikkipitt: has joined #RubyOnRails
[19:29:04] rikkipitt: has joined #RubyOnRails
[19:30:48] rikkipitt: has joined #RubyOnRails
[19:33:22] zandimna: has joined #RubyOnRails
[19:34:35] rikkipitt: has joined #RubyOnRails
[19:37:43] zandimna: so, with bootsnap disabled, i still can't use rails console.
[19:38:00] zandimna: this comes out when i try: https://dpaste.de/kqPX
[19:38:34] zandimna: this has been happening since ruby 2.6 update
[19:59:01] mikecmpbll: has joined #RubyOnRails
[20:04:04] eckhardt: has joined #RubyOnRails
[20:06:40] havenwood: zandimna: Did you check what $LOAD_PATH was set to on line 291 of lib/active_support/dependencies.rb?
[20:07:47] havenwood: zandimna: What do you get for?: dirname "$(gem which irb)"
[20:09:48] havenwood: zandimna: That ^ dir is expected to be in $LOAD_PATH, but *seems* to not be at the point of line 291.
[20:16:30] havenwood: zandimna: You might want to weigh in here, since it appears to be an identical issue and you might be able to move along resolution by narrowing the possible culprits: https://github.com/Shopify/bootsnap/issues/223
[20:20:01] havenwood: zandimna: What's the exact command you're running to get that output?
[20:20:43] havenwood: zandimna: Can you show us the stacktrace with that same command prefixed with?: DISABLE_SPRING=1
[20:24:23] ariedler: has joined #RubyOnRails
[20:38:08] zandimna: so LOAD_PATH was not set
[20:38:37] zandimna: if i prefix the rails console command by setting it to that directory it still gives the same error
[20:39:22] zandimna: same with exporting
[20:40:16] havenwood: zandimna: By "not set" do you mean it's an empty Array? Or it's nil?
[20:40:29] zandimna: echo returns nothing
[20:40:30] havenwood: zandimna: What was the path?
[20:40:40] havenwood: zandimna: dirname "$(gem which irb)"
[20:40:56] zandimna: ~/.gem/ruby/2.6.0/gems/irb-1.0.0/lib
[20:41:12] Fernando-Basso: has joined #RubyOnRails
[20:41:33] zandimna: has joined #RubyOnRails
[20:42:53] havenwood: zandimna: In Ruby, I'm wondering about the constant $LOAD_PATH, not a Shell environment variable. How are you checking it?
[20:43:40] zandimna: so, `p $LOAD_PATH` returns this
[20:43:53] raunicolae: has joined #RubyOnRails
[20:44:03] zandimna: ["/home/zandimna/.gem/ruby/2.6.0/gems/irb-1.0.0/lib", "/usr/lib/ruby/site_ruby/2.6.0", "/usr/lib/ruby/site_ruby/2.6.0/x86_64-linux", "/usr/lib/ruby/site_ruby", "/usr/lib/ruby/vendor_ruby/2.6.0", "/usr/lib/ruby/vendor_ruby/2.6.0/x86_64-linux", "/usr/lib/ruby/vendor_ruby", "/usr/lib/ruby/2.6.0", "/usr/lib/ruby/2.6.0/x86_64-linux"]
[20:44:30] raunicolae: has left #RubyOnRails: ()
[20:45:25] zandimna: if i use ruby -e instead it doesn't have the first path
[20:47:06] srinidhi: has joined #RubyOnRails
[20:48:54] havenwood: zandimna: Yeah, your irb.rb file is in an odd location. It seems the other gems are all in system locations, but IRB is in your home dir. What I'm curious about as well is what $LOAD_PATH is on the line it's failing on.
[20:49:30] havenwood: zandimna: You can add a `p $LOAD_PATH` on the line in your editor: gem open activesupport
[20:49:32] zandimna: i installed irb with both gem and archlinux pacman so i think it should be in both locations
[20:49:45] havenwood: zandimna: To restore the unedited gem: gem pristine activesupport
[20:49:48] gambl0r3: has joined #RubyOnRails
[20:50:10] havenwood: zandimna: I think your pacman gem setup is borking things.
[20:50:34] orbyt_: has joined #RubyOnRails
[20:50:55] havenwood: zandimna: Here's jhass' arch setup, which is nifty: https://gist.github.com/jhass/8839655bb038e829fba1
[20:51:39] havenwood: zandimna: IRB is a gem that ships with Ruby. You shouldn't need to install an additional package.
[20:51:50] zandimna: if i remove it rails just stop workinga
[20:52:10] zandimna: maybe the arch version doesn't have irb in it
[20:53:07] zandimna: where do i put that like
[20:53:13] tdy: has joined #RubyOnRails
[20:54:36] tdy1: has joined #RubyOnRails
[20:58:15] zandimna: also something else seems weird: when i use `gem open activesupport` it opens my local gem folder but when i try to use `gem pristine activesupport` it points to the system gem location and says i don't have permission
[20:58:38] zandimna: except how rails is not installed system-wide
[20:58:51] havenwood: zandimna: It seems you have an odd mishmash of local and system install.
[20:59:13] zandimna: yeah possibly..
[21:01:53] zandimna: i'll try to use the rails package from arch.. maybe that'll fix it
[21:13:25] ivanskie: has joined #RubyOnRails
[21:35:08] eclm: has joined #RubyOnRails
[21:37:51] blackcross: has joined #RubyOnRails
[22:06:03] ivanskie: has joined #RubyOnRails
[22:13:11] blackmesa1: has joined #RubyOnRails
[22:24:08] Ocampa: has joined #RubyOnRails
[22:25:42] ariedler: has joined #RubyOnRails
[22:48:55] mksybr: has joined #RubyOnRails
[22:48:57] mksybr: I'm having an issue somewhere in my user-auth tests, I'm following the Rails Tutorial and as far as I can tell all the relevant code is the same yet I'm getting the errors from errors.log Relevant branch is updating-users github.com/Aeyk/railstut/tree/updating-users
[22:59:24] zandimna: mksybr: which test is not passing?
[23:00:35] mksybr: https://pastebin.com/raw/tPb41GjZ
[23:00:53] mksybr: Three are not, but Im focusing on "test successful edit"
[23:00:58] mksybr: https://pastebin.com/raw/tPb41GjZ
[23:03:28] zandimna: mksybr: so for the first one i think you should put `follow_redirect` before `assert_redirected_to`
[23:03:48] havenwood: mksybr: looks like you're not logging in
[23:05:05] zandimna: yeah the successful edit test seems to lack a `log_in_as`
[23:05:50] zandimna: arrggh now my rails console broke i can't really follow the tutorial :\
[23:05:53] mksybr: Awesome Thanks will try that.
[23:22:20] blackmesa1: has joined #RubyOnRails
[23:33:11] elcontrastador: has joined #RubyOnRails
[23:36:37] blackmesa: has joined #RubyOnRails
[23:45:40] duderonomy: has joined #RubyOnRails
[23:45:58] funnel: has joined #RubyOnRails
[23:50:10] cnsvc: has joined #RubyOnRails