« Back to channel list

#RubyOnRails - 28 April 2018

« Back 1 day Forward 1 day »
[00:05:42] LateralO1: has joined #RubyOnRails
[00:11:02] eckhardt: has joined #RubyOnRails
[00:15:05] workmad3: has joined #RubyOnRails
[00:27:34] alfiemax: has joined #RubyOnRails
[00:29:35] Linuus: has joined #RubyOnRails
[00:33:56] cpruitt: has joined #RubyOnRails
[00:50:08] cpruitt: has joined #RubyOnRails
[00:54:56] alfiemax: has joined #RubyOnRails
[00:58:29] kurko_: has joined #RubyOnRails
[01:06:54] d6chung: has joined #RubyOnRails
[01:07:46] cpruitt: has joined #RubyOnRails
[01:12:08] d6chung: Hi, I upgraded to Ubuntu 18.04 and now running rake segfaults: ../activerecord-4.2.7.1/lib/active_record/connection_adapters/postgresql_adapter.rb:651: [BUG] Segmentation fault at 0x00000000000000. I tried rebuilding but can't seem to get around the issue. This paritcular app is on ruby 2.3.0.
[01:14:26] apeiros: has joined #RubyOnRails
[01:20:14] fryguy: what did you try rebuilding
[01:20:15] Linuus: has joined #RubyOnRails
[01:20:54] d6chung: fryguy: ruby and gems
[01:21:50] fryguy: how did you rebuild gems
[01:25:55] d6chung: With bundler at first but then I had puma failing to compile, which prompted me to install openssl1.0-dev and that allowed me to proceed with the build -- now I just can't run rake.
[01:26:39] fryguy: that's a different problem than you described earlier
[01:26:56] d6chung: Right but I think I got past that.
[01:27:03] fryguy: oh well ok
[01:27:07] fryguy: i was trying to help with that you
[01:27:16] fryguy: thanks for the update
[01:28:28] d6chung: I'm thinking it's an Ubuntu-specific issue since I have another box with the same setup that's working fine but was hoping someone here may have encountered it too.
[01:29:18] fryguy: what issue..
[01:30:46] d6chung: The segfaulting rake.
[01:31:24] fryguy: ok, you said you solved the segfault earlier, now you didn't. i'm super confused now
[01:31:31] fryguy: why don't you try to actually describe what's going on
[01:34:22] d6chung: Sorry, let me try to clarify: I upgraded to Ubuntu 18.04 from 17.10; running my RoR app resulted in ruby complaining it couldn't find libraries; so I started rebuilding to hopefully just update references; compilation failed at first but that was due to incompatible openssl, which is resolved; everything is now built but running rake results in the segault, which is where I currently am.
[01:36:00] fryguy: ok, and how are you gems installed?
[01:36:13] d6chung: With bundler
[01:36:19] fryguy: and how is bundler installed
[01:36:33] d6chung: Manually with gem install.
[01:36:40] fryguy: and how is the gem binary installed
[01:36:51] lupine: comes with ruby, from 1.9 or so
[01:37:14] d6chung: Oh, probably crucial detail: I use rvm too.
[01:37:17] fryguy: lupine: yes, but that's not really the answer
[01:37:22] fryguy: ^^ is kind of the answer I was looking for
[01:37:31] fryguy: and did your rvm installation port over?
[01:38:17] d6chung: I did upgrade it after the release I think.
[01:38:27] fryguy: so when you "reinstalled gems" did you actually reinstall gems? or just reuse existing stuff from rvm?
[01:40:10] d6chung: I think so. I ran gem uninstall -aIx and started over.
[01:40:45] fryguy: try doing `bundle install --deployment` and seeing if that changes things
[01:41:01] fryguy: that'll stop using system installed gems and help eliminate causes
[01:41:48] lupine: ACTION strokes beard, thinks back to manually installing rubygems separately
[01:44:57] d6chung: fryguy: No change. It did seemingly fetch and installed everything but rake still segfaults.
[01:45:45] fryguy: show the full stacktrace
[01:45:50] fryguy: and the contents of gemfile.lock
[01:50:03] darkhanb: has joined #RubyOnRails
[01:58:28] Linuus: has joined #RubyOnRails
[02:02:08] d6chung: Stacktrace and dump: https://bpaste.net/show/218d541f525a
[02:02:22] d6chung: Gemfile.lock: https://bpaste.net/show/dc25fe2b77ff
[02:06:15] fryguy: and did you recompile ruby after switching?
[02:06:24] fryguy: specifically to recompile this: ~/.rvm/rubies/ruby-2.3.0/lib/libruby.so.2.3(
[02:07:39] d6chung: Via rvm, yes. The time modified on that is recent.
[02:09:15] fryguy: any rvm specific errata for ubuntu? i know rvm does some special compilation for things
[02:13:59] workmad3: has joined #RubyOnRails
[02:19:46] orbyt_: has joined #RubyOnRails
[02:21:41] d6chung: Not that I'm aware of. I think I'm going to try completely gutting everything and starting over -- rvm and all. Tempted to switch to rbenv.
[02:23:20] d6chung: fryguy: Thanks for the help!
[02:29:01] kapil___: has joined #RubyOnRails
[02:29:46] ule: Hey folks
[02:29:53] ule: What do you use for rate-limit your APIs?
[02:31:15] Technodrome: has joined #RubyOnRails
[02:33:40] lupine: I know people use Rack::Attack
[02:36:02] Linuus: has joined #RubyOnRails
[02:37:54] ule: lupine: thanks. Added to my to do (study) list
[02:38:17] mjolnird: has joined #RubyOnRails
[02:53:44] xall: has joined #RubyOnRails
[03:07:21] Technodrome: has joined #RubyOnRails
[03:14:05] Linuus: has joined #RubyOnRails
[03:19:43] tdy: has joined #RubyOnRails
[04:03:04] kurko_: has joined #RubyOnRails
[04:10:02] eckhardt: has joined #RubyOnRails
[04:12:51] workmad3: has joined #RubyOnRails
[04:21:22] Linuus: has joined #RubyOnRails
[04:39:39] cpruitt: has joined #RubyOnRails
[04:54:54] tfitts: has joined #RubyOnRails
[05:00:57] _aeris_: has joined #RubyOnRails
[05:01:36] Linuus: has joined #RubyOnRails
[05:02:18] jnollette: has joined #RubyOnRails
[05:09:13] eckhardt: has joined #RubyOnRails
[05:19:13] jane_booty_doe: has joined #RubyOnRails
[05:35:46] Linuus: has joined #RubyOnRails
[05:43:12] Vircung: has joined #RubyOnRails
[05:45:41] dachi: has joined #RubyOnRails
[05:46:55] dachi: Hello. I have a question about Devise if you use it. How do you separate part of initializer for different environments? I need to set up different omniauth tokens for development and production environments in devise.rb.
[05:48:22] dachi: I can use environment variables with Figaro but I'm just asking if there is some standard way for doing this.
[05:53:16] jane_booty_doe: what you said sounds fine
[05:55:21] reber: has joined #RubyOnRails
[05:57:23] LateralOctober: has joined #RubyOnRails
[06:05:08] conta: has joined #RubyOnRails
[06:10:38] mr-spoon: has joined #RubyOnRails
[06:11:48] workmad3: has joined #RubyOnRails
[06:13:37] Linuus: has joined #RubyOnRails
[06:26:11] mr-spoon: has joined #RubyOnRails
[06:34:10] mr-spoon: has joined #RubyOnRails
[06:43:04] sevenseacat: has joined #RubyOnRails
[06:48:15] mr-spoon: has joined #RubyOnRails
[06:48:34] Linuus: has joined #RubyOnRails
[06:53:38] michela: has joined #RubyOnRails
[06:55:04] michela: has left #RubyOnRails: ()
[07:00:59] Linuus: has joined #RubyOnRails
[07:11:32] beilabs_: has joined #RubyOnRails
[07:12:33] Saukk: has joined #RubyOnRails
[07:22:53] beilabs: has joined #RubyOnRails
[07:23:50] Linuus: has joined #RubyOnRails
[07:27:41] dionysus69: has joined #RubyOnRails
[07:35:45] beilabs_: has joined #RubyOnRails
[07:37:55] Cache_Money: has joined #RubyOnRails
[07:55:59] Linuus`: has joined #RubyOnRails
[07:57:55] LateralO1: has joined #RubyOnRails
[08:00:09] dedeqtor: has joined #RubyOnRails
[08:06:17] Cache_Money: I need some help with a SQL/ActiveRecord query. Here are my models: https://gist.github.com/SuperFexy/5eedb7fa124c63fdc5f11cd8ab8148d7
[08:06:57] Cache_Money: For a given site (site_abbreviation), I'd like to sum up all metrics by month (for 1 or more BrightcovePlayer instances)
[08:07:17] Cache_Money: Having trouble thinking about how to solve this within one of my controllers
[08:07:43] _aeris_: has joined #RubyOnRails
[08:12:57] qyliss: Cache_Money: are you just looking for the sum of video views for a given player?
[08:13:57] Cache_Money: qyliss: No, I'm looking at the sum of video views for all of the @brightcove_players
[08:14:11] Cache_Money: ^ grouped together by month
[08:16:34] qyliss: Cache_Money: I think that would be `@brightcove_players.group(:year, :month).sum(:brightcove_video_views)` or something like it
[08:17:46] Cache_Money: qyliss: I have two separate models. I'm looking for MonthlyBrightcoveVideoPlay.video_views for each of the @brightcove_players
[08:18:01] qyliss: Oh, I missed a join
[08:18:41] qyliss: Cache_Money: I think that would be `@brightcove_players.joins(:monthly_brightcove_video_views).group(:year, :month).sum(:brightcove_video_views)`
[08:19:02] Cache_Money: qyliss: That looks right! Let me check it out in my rails console
[08:19:07] marr: has joined #RubyOnRails
[08:20:52] Cache_Money: qyliss: Sweet, that's exactly what I'm looking for! I forgot about the .join() method
[08:20:56] Cache_Money: I appreciate it!
[08:22:10] qyliss: No worries!
[08:30:06] Linuus`: has joined #RubyOnRails
[08:36:55] jane_booty_doe: has joined #RubyOnRails
[08:39:36] Puffball: has joined #RubyOnRails
[08:39:51] workmad3: has joined #RubyOnRails
[09:14:32] Linuus`: has joined #RubyOnRails
[09:19:22] sameerynho: has joined #RubyOnRails
[09:31:16] Technodrome: has joined #RubyOnRails
[09:31:30] Sylario: has joined #RubyOnRails
[09:44:35] kapil___: has joined #RubyOnRails
[09:58:31] LateralOctober: has joined #RubyOnRails
[09:59:47] Linuus`: has joined #RubyOnRails
[10:34:01] Linuus`: has joined #RubyOnRails
[10:35:53] Technodrome: has joined #RubyOnRails
[10:49:37] ellcs: has joined #RubyOnRails
[10:53:56] Technodrome: has joined #RubyOnRails
[11:12:55] Linuus`: has joined #RubyOnRails
[11:21:39] NoGodDamnIdea: has joined #RubyOnRails
[11:47:32] ellcs: has joined #RubyOnRails
[11:50:16] Linuus`: has joined #RubyOnRails
[11:59:07] LateralO1: has joined #RubyOnRails
[12:22:14] cstls: has joined #RubyOnRails
[12:41:04] sagax: has joined #RubyOnRails
[12:56:04] Linuus`: has joined #RubyOnRails
[13:03:58] ellcs: has joined #RubyOnRails
[13:35:17] Linuus`: has joined #RubyOnRails
[13:58:59] kurko_: has joined #RubyOnRails
[13:59:45] LateralOctober: has joined #RubyOnRails
[14:01:14] schneider: has joined #RubyOnRails
[14:11:51] alfiemax: has joined #RubyOnRails
[14:13:16] Linuus`: has joined #RubyOnRails
[14:14:28] srinidhi: has joined #RubyOnRails
[14:23:04] schneider: has joined #RubyOnRails
[14:29:14] schneider: has joined #RubyOnRails
[14:34:01] dionysus69: has joined #RubyOnRails
[14:38:28] schneider: has joined #RubyOnRails
[14:42:30] jnollette: has joined #RubyOnRails
[14:47:45] schneider: has joined #RubyOnRails
[14:49:39] Linuus`: has joined #RubyOnRails
[14:57:05] schneider: has joined #RubyOnRails
[15:06:21] schneider: has joined #RubyOnRails
[15:10:12] Dimik: has joined #RubyOnRails
[15:13:20] rfoust: has joined #RubyOnRails
[15:14:40] schneider: has joined #RubyOnRails
[15:23:57] schneider: has joined #RubyOnRails
[15:27:25] Linuus`: has joined #RubyOnRails
[15:33:23] schneider: has joined #RubyOnRails
[15:42:34] schneider: has joined #RubyOnRails
[15:51:56] schneider: has joined #RubyOnRails
[15:56:23] prahal: has joined #RubyOnRails
[15:56:55] defsdoor: has joined #RubyOnRails
[16:00:24] LateralO1: has joined #RubyOnRails
[16:01:13] schneider: has joined #RubyOnRails
[16:02:30] beilabs: has joined #RubyOnRails
[16:09:08] orbyt_: has joined #RubyOnRails
[16:10:31] schneider: has joined #RubyOnRails
[16:10:53] Saukk: has joined #RubyOnRails
[16:16:16] samosa: has joined #RubyOnRails
[16:19:56] schneider: has joined #RubyOnRails
[16:25:05] cstls: has joined #RubyOnRails
[16:25:55] mroutis: has joined #RubyOnRails
[16:28:07] DrYockel: has joined #RubyOnRails
[16:29:13] schneider: has joined #RubyOnRails
[16:33:48] Technodrome: has joined #RubyOnRails
[16:36:54] Linuus`: has joined #RubyOnRails
[16:38:27] schneider: has joined #RubyOnRails
[16:47:19] orbyt_: has joined #RubyOnRails
[16:47:48] schneider: has joined #RubyOnRails
[16:47:50] conta: has joined #RubyOnRails
[16:53:21] cstls: has joined #RubyOnRails
[16:57:10] schneider: has joined #RubyOnRails
[17:06:24] schneider: has joined #RubyOnRails
[17:07:46] woohoou: has joined #RubyOnRails
[17:16:08] schneider: has joined #RubyOnRails
[17:17:53] Linuus`: has joined #RubyOnRails
[17:25:30] schneider: has joined #RubyOnRails
[17:34:56] schneider: has joined #RubyOnRails
[17:35:30] uksio: has joined #RubyOnRails
[17:44:16] schneider: has joined #RubyOnRails
[17:44:58] cstls: has joined #RubyOnRails
[17:53:36] schneider: has joined #RubyOnRails
[17:59:41] Linuus`: has joined #RubyOnRails
[18:02:51] schneider: has joined #RubyOnRails
[18:03:59] orbyt_: has joined #RubyOnRails
[18:11:09] schneider: has joined #RubyOnRails
[18:13:03] sameerynho: has joined #RubyOnRails
[18:18:14] dedeqtor: has joined #RubyOnRails
[18:20:29] schneider: has joined #RubyOnRails
[18:29:54] schneider: has joined #RubyOnRails
[18:39:11] schneider: has joined #RubyOnRails
[18:43:51] Linuus`: has joined #RubyOnRails
[18:47:00] chouhoulis: has joined #RubyOnRails
[18:48:37] schneider: has joined #RubyOnRails
[18:51:03] DTZUZO: has joined #RubyOnRails
[18:57:47] schneider: has joined #RubyOnRails
[19:02:00] marr: has joined #RubyOnRails
[19:05:53] conta: has joined #RubyOnRails
[19:07:09] schneider: has joined #RubyOnRails
[19:10:33] orbyt_: has joined #RubyOnRails
[19:16:25] schneider: has joined #RubyOnRails
[19:21:33] Linuus`: has joined #RubyOnRails
[19:25:41] schneider: has joined #RubyOnRails
[19:29:11] alfiemax: has joined #RubyOnRails
[19:30:47] chouhoulis: has joined #RubyOnRails
[19:33:21] cstls: has joined #RubyOnRails
[19:35:02] schneider: has joined #RubyOnRails
[19:40:19] srruby: has joined #RubyOnRails
[19:41:27] srruby: react.js: For a large app do you recommend separate rails apps for serving the api and a second rails app for serving web pages/react components/etc
[19:43:53] alfiemax: has joined #RubyOnRails
[19:43:58] nogic: has joined #RubyOnRails
[19:44:22] schneider: has joined #RubyOnRails
[19:50:49] NoGodDamnIdea: has joined #RubyOnRails
[19:52:42] segy: has joined #RubyOnRails
[19:53:40] schneider: has joined #RubyOnRails
[19:59:22] AlHafoudh: has joined #RubyOnRails
[20:00:16] alfiemax: has joined #RubyOnRails
[20:01:00] ur5us: has joined #RubyOnRails
[20:02:17] Linuus`: has joined #RubyOnRails
[20:02:57] schneider: has joined #RubyOnRails
[20:05:25] beilabs: has joined #RubyOnRails
[20:05:26] alfiemax: has joined #RubyOnRails
[20:11:55] tekk: hi, I have a rails runner that I have to keep manually starting (it basically runs a periodic process that requires rails environment)... i've tried to get this to start on system boot by using systemd and rc.d etc... but it seems to spawn multiple instances... is there any ruby/rails specific way of automatically invoking this? My production instance uses passenger and nginx to serve
[20:12:10] schneider: has joined #RubyOnRails
[20:12:20] ellcs: has joined #RubyOnRails
[20:16:00] big_reggie: has joined #RubyOnRails
[20:16:54] big_reggie: how do you guys keep state consistent for tests that rely on fixtures (e.g. what if the fixtures a test relies on gets changed in the future?)
[20:17:09] big_reggie: do you check the required state with asserts before the test starts
[20:18:19] fryguy: transactional fixtures handles that
[20:21:35] schneider: has joined #RubyOnRails
[20:25:24] weaksauce: has joined #RubyOnRails
[20:27:55] cstls: has joined #RubyOnRails
[20:29:31] big_reggie: fryguy: i mean if someone literally changes the fixture files themselves
[20:30:57] schneider: has joined #RubyOnRails
[20:34:36] fryguy: most ci/cd setups start from an empty database each time
[20:34:47] fryguy: so that shouldn't be an issue
[20:38:33] alfiemax: has joined #RubyOnRails
[20:40:05] Linuus`: has joined #RubyOnRails
[20:40:10] schneider: has joined #RubyOnRails
[20:49:29] schneider: has joined #RubyOnRails
[20:49:38] big_reggie: fryguy: my apologies, i mean for example if I look at the YAML fixture files, see they have some structure, then a year later another developer comes in and changes those YAML files
[20:50:07] big_reggie: not knowing that it would affect specific tests
[20:51:27] alfiemax: has joined #RubyOnRails
[20:52:36] fryguy: ok, so then the tests fail, and then you fix them...
[20:54:33] big_reggie: fryguy: they may not fail
[20:54:41] big_reggie: they may start to silently always pass
[20:54:52] big_reggie: and become useless tests
[20:55:16] fryguy: can you cite an example? I'd like to see a situation with well-written tests that would behave this way
[20:58:48] schneider: has joined #RubyOnRails
[20:59:03] big_reggie: fryguy: any test that checks that there are no associations under specific conditions between two models (when you expect assocations in the fixtures to exist)
[21:00:04] alfiemax: has joined #RubyOnRails
[21:00:09] fryguy: can you be more specific?
[21:03:17] big_reggie: fryguy: e.g. you want to test some User can't access some of his Books without a premium subscription, so a test that calling user.getBooks returns an empty array under those conditions
[21:03:35] big_reggie: but if someone removes the books for that user then it would always pass
[21:03:52] fryguy: you are missing a test there then
[21:03:59] fryguy: that you CAN get boooks if you do have a premium subscription
[21:04:13] fryguy: if you change the fixutre, that test will now fail, clueing you in
[21:04:26] fryguy: at unit level, you need both negative and positive assertions for cases
[21:04:37] big_reggie: very good point, never thought of that
[21:05:23] fryguy: here's some more information based on the theory of the testing pyramid: https://martinfowler.com/articles/practical-test-pyramid.html#WhatToTest
[21:05:25] big_reggie: so really you would need to make sure you are using the same user in both unit tests
[21:08:08] schneider: has joined #RubyOnRails
[21:09:08] roshanavand: has joined #RubyOnRails
[21:09:12] big_reggie: i see now, my mistake was more dealing with negative assertions (which need positive assertion tests coupled to them)
[21:09:19] big_reggie: fryguy: thanks
[21:17:23] schneider: has joined #RubyOnRails
[21:21:19] alfiemax: has joined #RubyOnRails
[21:22:01] srruby: has joined #RubyOnRails
[21:23:19] matt_d: Does anyone have an idea on when ConFreaks will post the RailsConf 2018 vids?
[21:26:45] schneider: has joined #RubyOnRails
[21:29:49] alfiemax: has joined #RubyOnRails
[21:36:02] schneider: has joined #RubyOnRails
[21:45:17] schneider: has joined #RubyOnRails
[21:48:46] darkhanb: has joined #RubyOnRails
[21:49:40] Linuus`: has joined #RubyOnRails
[21:50:56] alfiemax: has joined #RubyOnRails
[21:54:30] armyriad: has joined #RubyOnRails
[21:54:33] schneider: has joined #RubyOnRails
[22:03:54] schneider: has joined #RubyOnRails
[22:11:18] schneider: has joined #RubyOnRails
[22:11:52] GodFather: has joined #RubyOnRails
[22:20:36] schneider: has joined #RubyOnRails
[22:28:13] Linuus`: has joined #RubyOnRails
[22:29:57] schneider: has joined #RubyOnRails
[22:35:29] schneider: has joined #RubyOnRails
[22:37:09] alfiemax: has joined #RubyOnRails
[22:46:16] alfiemax: has joined #RubyOnRails
[22:50:48] schneider: has joined #RubyOnRails
[22:58:53] alfiemax: has joined #RubyOnRails
[23:00:08] schneider: has joined #RubyOnRails
[23:09:23] schneider: has joined #RubyOnRails
[23:09:27] Cache_Money: has joined #RubyOnRails
[23:10:02] Linuus`: has joined #RubyOnRails
[23:11:06] cstls: has joined #RubyOnRails
[23:12:26] sandroqz: has joined #RubyOnRails
[23:16:02] sandroqz: hi guys, I need to upload a CSV file and then show a preview of the data. if the user hit confirm then the data should be persisted to the db otherwise the data is cleaned up. what is the best way to do this? thanks.
[23:18:46] schneider: has joined #RubyOnRails
[23:22:23] fryguy: guess it depends on what is necessary business logic wise to generate the preview
[23:23:24] fryguy: if it's just a reification of the CSV file, then upload the CSV to some sort of centralized object store like S3. if you need to do a lot of processing, consider doing the same thing if you can stand the request overhead, or put the work into a background job with a status checker. alternatively create a temporary table to store the data.
[23:28:03] schneider: has joined #RubyOnRails
[23:28:42] srruby: has joined #RubyOnRails
[23:30:02] sandroqz: fryguy, i just need to show the CSV data to the user. if he/she hits enter then the data should be persisted.
[23:31:51] sandroqz: unfortunately i can't upload to S3... i can upload to my server but after the data is persisted i need to remove the file
[23:37:05] alfiemax: has joined #RubyOnRails
[23:37:18] schneider: has joined #RubyOnRails
[23:42:55] Technodrome: has joined #RubyOnRails
[23:43:50] creature: has joined #RubyOnRails
[23:46:38] schneider: has joined #RubyOnRails
[23:47:09] one_zero: has joined #RubyOnRails
[23:48:19] Linuus`: has joined #RubyOnRails
[23:54:14] alfiemax: has joined #RubyOnRails
[23:55:57] schneider: has joined #RubyOnRails