« Back to channel list

#RubyOnRails - 20 February 2018

« Back 1 day Forward 1 day »
[00:06:48] alfiemax: has joined #RubyOnRails
[00:11:15] cagomez: has joined #RubyOnRails
[00:13:43] schneide_: has joined #RubyOnRails
[00:23:35] alfiemax: has joined #RubyOnRails
[00:31:26] jcarl43: has joined #RubyOnRails
[00:36:37] alfiemax: has joined #RubyOnRails
[00:36:44] hndk: has joined #RubyOnRails
[00:37:45] ghormoon: has joined #RubyOnRails
[00:50:50] kapil___: has joined #RubyOnRails
[00:54:16] fragamus: has joined #RubyOnRails
[00:56:57] workmad3: has joined #RubyOnRails
[01:11:03] alfiemax: has joined #RubyOnRails
[01:18:24] chocoelho: has joined #RubyOnRails
[01:33:44] ghormoon: has joined #RubyOnRails
[01:42:19] andrewray: has joined #RubyOnRails
[01:42:51] andrewray: Why does Time.now.utc.iso8601 have the timezone "Z", but DateTime.now.utc.iso8601 has the timezone "+00:00" ?
[01:43:03] andrewray: Does this have to do with rails' monkepatching of datetime?
[01:46:13] andrewray: the Time docs don't mention this http://ruby-doc.org/core-2.2.0/Time.html which is strange, they only have it in an example, not documentation for it at all
[01:49:18] alfiemax: has joined #RubyOnRails
[02:06:17] alfiemax: has joined #RubyOnRails
[02:17:48] andrewray: oh my god is it worse than that
[02:18:11] andrewray: why does DateTime.to_time return a DateTime?!
[02:18:44] andrewray: oh god it has something to do with the timezone
[02:22:58] alfiemax: has joined #RubyOnRails
[02:23:24] andrewray: this is some ruby or rails version ridiculousness too
[02:23:51] andrewray: In Ruby 2.1.5, DateTime.new.to_time.class.name is "Time" ok makes sense
[02:24:24] andrewray: but if it has a timezone, DateTime.parse('1st Jan 2001 00:00:00+01:00').to_time.class.name is "DateTime"
[02:24:32] andrewray: it took the to_time conversion and discarded it lol
[02:25:29] andrewray: i guess this could be a rails version thing too
[02:37:05] arthurz: has joined #RubyOnRails
[02:37:20] arthurz: Hi there, does anyone know here if I make changes to Rails app code, and I use Passanger, do I need to re-compile it into public?
[02:49:58] Rodya_: has joined #RubyOnRails
[02:50:05] auv: has joined #RubyOnRails
[02:52:23] fryguy: arthurz: depends on some settings, but the answer is "probably yes", and if the answer turns out to be "no" you shoudl change it so that the answer is "yes" because you are likely costing yourself some pretty significant performance
[02:57:17] workmad3: has joined #RubyOnRails
[02:59:34] fragamus: has joined #RubyOnRails
[03:05:41] Exuma: has joined #RubyOnRails
[03:14:30] kies: has joined #RubyOnRails
[03:18:57] alfiemax: has joined #RubyOnRails
[03:22:12] morenoh149: has joined #RubyOnRails
[03:25:32] Saukk: has joined #RubyOnRails
[03:26:06] darkhanb: has joined #RubyOnRails
[03:31:45] alfiemax: has joined #RubyOnRails
[03:43:31] elcontrastador: has joined #RubyOnRails
[03:43:54] DTZUZO: has joined #RubyOnRails
[03:45:22] Rodya_: has joined #RubyOnRails
[03:48:18] alfiemax: has joined #RubyOnRails
[03:52:28] Rodya_: has joined #RubyOnRails
[04:01:34] alfiemax: has joined #RubyOnRails
[04:01:57] arthurz: Thanks @fryguy, how to compile the changed code?
[04:04:54] mattwc: you don't really compile with ruby, you just reload the code / restart the web server to load the changes
[04:05:39] Rodya_: has joined #RubyOnRails
[04:07:10] arthurz: Oh so it is smart enough to do the magic so the updated code gets packaged into the `public` directory @mattwc?
[04:07:36] mattwc: ah you're talking about front end code compliation
[04:09:51] mattwc: that kinda depends on how you built your front end stuff, if you're using the default rails asset pipeline, etc http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets talks about how to pre-compile the assets assuming the default / built in pipeline
[04:15:05] hndk: has joined #RubyOnRails
[04:15:18] Cache_Money: has joined #RubyOnRails
[04:16:06] arthurz: yeah I guess so mattwc, the person who took the code to the web box pre-compiled it I was told. Nginx + Passanger is the setup
[04:16:11] morenoh149: has joined #RubyOnRails
[04:16:24] arthurz: So how to update the changes?
[04:16:47] mattwc: arthurz: the link I provided has the rake task to compile assets
[04:17:08] mattwc: well the rails task to compile assets
[04:17:11] arthurz: oh ok, cool, thanks
[04:18:14] alfiemax: has joined #RubyOnRails
[04:18:23] Exuma: has joined #RubyOnRails
[04:25:15] trautwein: has joined #RubyOnRails
[04:31:12] alfiemax: has joined #RubyOnRails
[04:31:42] morenoh149: has joined #RubyOnRails
[04:34:01] kapil___: has joined #RubyOnRails
[04:35:36] jackhum: has joined #RubyOnRails
[04:38:24] fragamus: has joined #RubyOnRails
[04:51:05] orbyt_: has joined #RubyOnRails
[04:56:26] alfiemax: has joined #RubyOnRails
[04:57:44] workmad3: has joined #RubyOnRails
[05:04:47] ome: has joined #RubyOnRails
[05:16:59] morenoh149: has joined #RubyOnRails
[05:19:14] kies: has joined #RubyOnRails
[05:37:14] mtkd: has joined #RubyOnRails
[05:37:26] andrewray: I have a module like module Something ... my_method ->(a) {} which works in the context i'm using it in
[05:37:43] andrewray: but if I do my_method = lambda |a| do ... end it does not work
[05:37:49] andrewray: are these two things not equivalent?
[05:43:57] srinidhi: has joined #RubyOnRails
[05:46:40] Omnilord: andrewray, your syntax is off for the `do` block: the block argument should be to the right of the `do`
[05:53:11] srinidhi: has joined #RubyOnRails
[05:54:02] kies: has joined #RubyOnRails
[05:55:34] andrewray: Omnilord: understood, just a hand written typo, but it seems like asdf -> and asdf = lambda are different but I don't get why
[06:07:56] hndk: has joined #RubyOnRails
[06:08:44] schneide_: has joined #RubyOnRails
[06:09:34] Omnilord: oh, that is different. In the first you are passing the lambda as a parameter to my_method, in the second you are assigning the lambda as the value of my_method
[06:12:27] morenoh149: has joined #RubyOnRails
[06:16:49] andrewray: am I allowed to think that implicit parenthesis are the devil
[06:22:13] srinidhi: has joined #RubyOnRails
[06:25:44] andrewray: oh my god why isn't Time.now.utc.to_time a no-op
[06:25:55] andrewray: why does it include the current timezone
[06:30:28] srinidhi: has joined #RubyOnRails
[06:37:47] andrewray: why oh why does rails monkeypatch date objects
[06:42:51] andrewray: why does Time.now.utc.to_time remove the UTC
[06:43:04] andrewray: why did anyone think this was a good idea lol
[06:47:31] Voxxit: has joined #RubyOnRails
[06:52:57] andrewray: why is nothing documented in ruby
[06:53:01] andrewray: what is Time#zone
[06:53:30] andrewray: oh cause that's rails time
[06:58:13] workmad3: has joined #RubyOnRails
[07:01:33] apeiros: has joined #RubyOnRails
[07:06:28] morenoh149: has joined #RubyOnRails
[07:13:49] mtkd: has joined #RubyOnRails
[07:15:03] morenoh149: has joined #RubyOnRails
[07:20:06] conta: has joined #RubyOnRails
[07:27:49] roshanavand: has joined #RubyOnRails
[07:32:12] mtkd: has joined #RubyOnRails
[07:44:20] Dimik: has joined #RubyOnRails
[07:50:19] gambl0re: has joined #RubyOnRails
[07:51:58] apeiros: has joined #RubyOnRails
[07:55:22] mixnblend: has joined #RubyOnRails
[07:58:24] tbuehlmann: TIL: rails is a rudimentary web-application framework for fisher-price architecture and it's responsible for harassment on twitter
[07:58:30] Exuma: has joined #RubyOnRails
[08:01:31] kies: has joined #RubyOnRails
[08:04:40] kapil___: has joined #RubyOnRails
[08:10:36] morenoh149: has joined #RubyOnRails
[08:15:22] schneide_: has joined #RubyOnRails
[08:52:27] Ergo: has joined #RubyOnRails
[08:53:53] mtkd: has joined #RubyOnRails
[08:58:36] workmad3: has joined #RubyOnRails
[08:59:22] Rodya_: has joined #RubyOnRails
[09:00:55] reber: has joined #RubyOnRails
[09:02:16] jnollette: has joined #RubyOnRails
[09:04:35] morenoh149: has joined #RubyOnRails
[09:10:02] mrbubbles: has joined #RubyOnRails
[09:12:42] marr: has joined #RubyOnRails
[09:14:56] mrbubbles: FactoryBot - is there any way to extract common factory behaviour into a single class? Like concerns, basically, but for Factories?
[09:17:22] mrbubbles: Ah - you can just register traits globally
[09:18:24] jackhum: has joined #RubyOnRails
[09:23:03] rgr: has joined #RubyOnRails
[09:25:34] dionysus69: has joined #RubyOnRails
[09:34:37] rietta: has joined #RubyOnRails
[09:48:20] alfiemax: has joined #RubyOnRails
[09:50:21] kapil___: account belongs to role.
[09:50:21] kapil___: when i delete a role. it gives PG::ForeignKeyViolation.
[09:50:21] kapil___: how to handle this error properly? without crashing.
[09:53:52] tbuehlmann: kapil___: you want to add a `dependent` option on the other end (the has_one or has_many one) so the account is deleted/destroyed before the role is
[09:54:18] kapil___: tbuehlmann: what if i don't want to do it?
[09:54:46] kapil___: I want to handle errors.
[09:54:52] defsdoor: has joined #RubyOnRails
[09:56:13] kapil___: when i do role.destroy i want that it gives me nice error message
[09:57:13] tbuehlmann: so you want the user to manually delete the account before deleting the role?
[09:58:35] morenoh149: has joined #RubyOnRails
[09:58:54] tbuehlmann: never tried, but there seems to be a dependent option named restrict_with_error: http://guides.rubyonrails.org/association_basics.html#dependent
[10:00:17] kapil___: tbuehlmann: thanks i will try :restrict_with_error option.
[10:00:17] Rodya_: has joined #RubyOnRails
[10:00:51] mello: has joined #RubyOnRails
[10:14:38] Sylario: has joined #RubyOnRails
[10:14:44] alfiemax: has joined #RubyOnRails
[10:34:25] workmad3: has joined #RubyOnRails
[10:48:37] arBmind: has joined #RubyOnRails
[10:51:27] TvL2386: hey guys, I want to include someones code that does an api call
[10:51:32] TvL2386: the license permits that
[10:51:35] TvL2386: where do I put it?
[10:52:08] TvL2386: if I put it in the lib/ folder `rails console` cannot find it
[10:52:39] morenoh149: has joined #RubyOnRails
[10:52:46] TvL2386: lib seems the correct folder
[10:52:48] tbuehlmann: TvL2386: you'd need to add the lib directory to your autoload paths or eager_load paths so rails will search in there for constants/files
[10:53:29] TvL2386: would be a good convention for rails to do that automatically in my opinion
[10:53:43] TvL2386: while we're at it, do I have to create a subdir for the module name?
[10:54:32] tbuehlmann: we had that and it was changed so it wouldn't anymore
[10:55:50] tbuehlmann: if you have a module/namespace then having a directory for it in lib/ seems good. you could also add the path to that directory instead of lib
[10:56:52] TvL2386: tbuehlmann: thanks for the advice. I'll add the path indeed instead of lib... It seems there's a rake & assets folder as well in lib and don't want to mix stuff up there
[10:58:39] mtkd: has joined #RubyOnRails
[11:01:27] Rodya_: has joined #RubyOnRails
[11:23:15] thomasfedb: Thoughts on how best to package css/js assets as a gem?
[11:26:05] Cavallari: has joined #RubyOnRails
[11:31:03] morenoh149: has joined #RubyOnRails
[11:46:15] mikecmpbll: has joined #RubyOnRails
[11:47:41] mikecmpbll: anyone know what the easiest way to hook into activerecord typecasting is? (rails 4.2) i'd like to say, for X field on Y model, take this value and cast it to what it would be when i retrieve it from the DB
[11:47:59] mikecmpbll: for instance, given a string column and i have an integer, i'd like to get the integer as a string.
[11:48:24] mikecmpbll: because if i saved that integer to a varchar column, when i retrieve it back i'd get a string. (i explained that really fucking bad).
[11:53:00] alfiemax: has joined #RubyOnRails
[11:56:31] marr: has joined #RubyOnRails
[12:00:29] mikecmpbll: gotcha: 2.3.1 :013 > User.columns_hash['email'].cast_type.type_cast_from_user(12) => "12"
[12:02:20] Ergo: has joined #RubyOnRails
[12:02:22] Rodya_: has joined #RubyOnRails
[12:05:40] _aeris_: has joined #RubyOnRails
[12:07:05] jackhum_: has joined #RubyOnRails
[12:07:16] crst: has joined #RubyOnRails
[12:10:00] alfiemax: has joined #RubyOnRails
[12:10:04] crst: Hi, any recommendations for integrating a fast searchable select box for a dataset with a couple of thousand entries? Would you say this is already a case for ajax or is it ok to put it inside html? I tried chosen & select2, both are super unresponsive.
[12:16:07] jokke: has joined #RubyOnRails
[12:28:41] jackhum__: has joined #RubyOnRails
[12:29:25] thomasfedb: crst, I'd go ajax if you've got thousands of entries
[12:30:06] crst: thomasfedb: ok, thanks
[12:33:16] S007: has joined #RubyOnRails
[12:47:35] jokke: has joined #RubyOnRails
[12:49:20] za1b1tsu: has joined #RubyOnRails
[12:54:38] DTZUZO: has joined #RubyOnRails
[13:00:52] Cavallari1: has joined #RubyOnRails
[13:01:42] arthurz: has joined #RubyOnRails
[13:02:51] _aeris_: has joined #RubyOnRails
[13:04:11] Rodya_: has joined #RubyOnRails
[13:35:02] cagomez: has joined #RubyOnRails
[13:57:07] cagomez: has joined #RubyOnRails
[13:59:57] aero-224: has joined #RubyOnRails
[14:11:21] sidx64: has joined #RubyOnRails
[14:15:19] FrostCandy: has joined #RubyOnRails
[14:17:55] andrewray: has joined #RubyOnRails
[14:22:01] Cavallari1: has joined #RubyOnRails
[14:24:49] cagomez: has joined #RubyOnRails
[14:37:32] desperek: has joined #RubyOnRails
[14:38:20] jordansz: has joined #RubyOnRails
[14:38:35] jordansz: hi everyone is anyone usinq sidekiq
[14:39:04] jordansz: i have a problem with sidekiq process closes after a single job is run, the sidekiq process shutsdowns also
[15:05:53] Rodya_: has joined #RubyOnRails
[15:06:27] MrCrackPotBuilde: has joined #RubyOnRails
[15:06:59] MrCrackPotBuilde: Is it possible to have two controllers for a shop one that creates a shop and one that does everything else for the shop based on the shop id
[15:07:40] MrCrackPotBuilde: so the create shop controller would be an admin only feature and the update shop would be admin and shopowner
[15:08:15] MrCrackPotBuilde: i already have a shop built that a owner can edit but not sure how to implement the shop creation
[15:12:19] moei: has joined #RubyOnRails
[15:16:27] troys: has joined #RubyOnRails
[15:18:43] regedit_: has joined #RubyOnRails
[15:24:07] schneide_: has joined #RubyOnRails
[15:26:32] beingjohnm: MrCrackPotBuilde: you can use a second controller for a model but you'll need to be the shop creation views in a folder for the second controller. I believe.
[15:27:20] beingjohnm: Can somebody take a quick look at the weird results I'm getting from a where query using "NOT IN": https://gist.github.com/global001/da4227cac903e50d68d183e32aa7a8d6
[15:29:12] MrCrackPotBuilde: so leave the shop i have currently as is.. create a new model and controller indcluding views.. (views can be basic as only i will see them) .. as for the creat function could i use @shopPartner.shop_id to store its unique value meaning one controller and model with one database per shop owner
[15:31:24] beingjohnm: you don't need to create a new model
[15:32:41] mikecmpb_: has joined #RubyOnRails
[15:34:05] beingjohnm: It sounds like you need to remove the new and create methods from your shop controller and put them in a new controller. Move the new.html.erb from your shop controller views to the new controller views.
[15:37:52] S007: has joined #RubyOnRails
[15:38:08] bphogan: I solve this with an admin namespace. I’d have controllers/admin/shop_controller and controllers/shop_controller. The views and actions would be associated appropriately.
[15:44:23] OyoKooN: has joined #RubyOnRails
[15:45:02] krawchyk: has joined #RubyOnRails
[15:47:46] beingjohnm: btw, not sure if it matters but I'm on rails 4. But it seems to be a postgres thing.
[16:00:36] schneide_: has joined #RubyOnRails
[16:12:42] dviola: has joined #RubyOnRails
[16:13:58] apeiros__: has joined #RubyOnRails
[16:19:58] mikecmpbll: has joined #RubyOnRails
[16:27:14] Puffball: has joined #RubyOnRails
[16:29:36] mtkd: has joined #RubyOnRails
[16:31:50] srinidhi: has joined #RubyOnRails
[16:40:04] cagomez: has joined #RubyOnRails
[16:41:02] krawchyk: has joined #RubyOnRails
[16:42:39] DTZUZO: has joined #RubyOnRails
[16:45:14] Cache_Money: has joined #RubyOnRails
[16:52:19] troys: has joined #RubyOnRails
[16:59:29] beingjohnm: so it appears that you have to add IS NOT NULL to the end of a subquery when using NOT IN with postgres. e.g. User.where("users.id NOT IN (SELECT user_id FROM activities WHERE activities.created_at >= '2017-01-01' AND activities.created_at <= '2017-12-31' AND user_id IS NOT NULL)").count
[17:00:13] Cache_Money: has joined #RubyOnRails
[17:01:58] Cache_Money: has joined #RubyOnRails
[17:06:21] apeiros: has joined #RubyOnRails
[17:07:10] krawchyk: has joined #RubyOnRails
[17:07:22] Rodya_: has joined #RubyOnRails
[17:09:25] one_zero: has joined #RubyOnRails
[17:11:41] SteenJobs: has joined #RubyOnRails
[17:11:41] krawchyk: has joined #RubyOnRails
[17:12:19] schneide_: has joined #RubyOnRails
[17:12:36] jcarl43: has joined #RubyOnRails
[17:12:38] riotjoe: has joined #RubyOnRails
[17:16:54] AzaToth: has joined #RubyOnRails
[17:21:05] chouhoulis: has joined #RubyOnRails
[17:26:31] chouhoulis: has joined #RubyOnRails
[17:27:04] s2013: has joined #RubyOnRails
[17:27:46] riotjones: has joined #RubyOnRails
[17:27:47] safetypin: has joined #RubyOnRails
[17:32:54] darkhanb: has joined #RubyOnRails
[17:33:43] Saukk: has joined #RubyOnRails
[17:38:13] dionysus69: has joined #RubyOnRails
[17:47:29] orbyt_: has joined #RubyOnRails
[17:52:42] cagomez: has joined #RubyOnRails
[17:52:45] Cache_Money: has joined #RubyOnRails
[18:07:59] Rodya_: has joined #RubyOnRails
[18:16:25] waseem_: has joined #RubyOnRails
[18:23:11] workmad3: has joined #RubyOnRails
[18:26:43] sameerynho: has joined #RubyOnRails
[18:28:24] brent__: has joined #RubyOnRails
[18:30:29] brent__: anybody have good activerecord skills? I am trying to figure out how to distanct records from 2 different joins in a query
[18:38:08] andywww: has joined #RubyOnRails
[18:39:52] guacamole: has joined #RubyOnRails
[18:45:13] Rodya_: has joined #RubyOnRails
[18:48:05] dionysus69: there's little confusion I have about strong params, what's the exact use case? for only creating updating models? what if I just need to get object id through ajax, can I just get it through params[:id] or is it still considered to be better practice to use strong params in that case too?
[18:54:05] kapil___: has joined #RubyOnRails
[19:03:09] sameerynho: has joined #RubyOnRails
[19:06:02] francuz: has joined #RubyOnRails
[19:09:57] dnewkerk: has joined #RubyOnRails
[19:16:57] dnewkerk_: has joined #RubyOnRails
[19:18:51] dnewkerk: has joined #RubyOnRails
[19:26:14] tbuehlmann: dionysus69: it only allows for specific input keys and values. you wouldn't want your users let them set the boolean admin attribute of their objects to true when updating, right?
[19:26:37] dionysus69: well yes in that case I understand
[19:27:13] konos5_: has joined #RubyOnRails
[19:28:18] dionysus69: but what about just getting an id as I mentioned in the last example. like sending an id via ajax to get coresponding object children, should be a common use case, using strong params there feels like to be an extra step with an extra params method
[19:28:46] tbuehlmann: naw, I think it's safe to juse use params[:id] then
[19:28:59] riotjoe: has joined #RubyOnRails
[19:29:01] mikecmpbll: has joined #RubyOnRails
[19:29:05] dionysus69: haha ye, thats what I was going for :)
[19:29:18] dionysus69: thank to make it clear
[19:29:24] dionysus69: for making it*
[19:30:09] tbuehlmann: technically that could lead to you loading more than just one record though
[19:31:01] dionysus69: hmm? if user passes in array of ids? what do you mean?
[19:31:20] konos5_: Hi, I need some guidance over my table structuring. I have a table called `Countries` and another one called `States`. I link them using a foreign key but here’s the catch; The tables can’t be linked using the primary id attribute of Countries. They need to be linked through an area_id attribute which sits at the Countries table.
[19:31:42] dionysus69: well I use find_by method which has to return only one
[19:31:50] krawchyk: has joined #RubyOnRails
[19:32:26] konos5_: I have already used `add_foreign_key :states, :countries, primary_key: :area_id` but to no use...
[19:32:50] dionysus69: you can specificy foreign key in model manually
[19:33:03] konos5_: if I do `Countries.first.states << States.first`
[19:33:17] dionysus69: country has many states foreign_key: :area_id
[19:34:42] dionysus69: https://stackoverflow.com/questions/10640941/rails-custom-foreign-key-name-on-both-table
[19:35:06] mtkd: has joined #RubyOnRails
[19:35:33] morenoh149: has joined #RubyOnRails
[19:35:59] konos5_: the problem is that the foreign key is expecting the area_id
[19:36:15] konos5_: but is `<<` it still gets the primary id of the Country
[19:36:28] konos5_: instead of its area_id attribute
[19:37:18] dionysus69: well try custom primary key https://stackoverflow.com/questions/19050978/problems-setting-a-custom-primary-key-in-a-rails-4-migration
[19:38:04] dionysus69: http://ruby-journal.com/how-to-override-default-primary-key-id-in-rails/ look for self.primary_key = 'sku' under model
[19:41:38] SteenJobs: has joined #RubyOnRails
[19:44:53] alfiemax: has joined #RubyOnRails
[19:46:26] konos5_: :dionysus69: basically the post you posted did the trick! Thanks again!
[19:56:18] dionysus69: glad it worked
[20:15:56] arBmind: has joined #RubyOnRails
[20:17:45] nopolitica: has joined #RubyOnRails
[20:28:27] Dimik: has joined #RubyOnRails
[20:33:15] Radar: GOOD MORNING
[20:34:02] Exuma: has joined #RubyOnRails
[20:35:31] tycoon177: what is a normal amount of memory usage for a mid-sized rails app? i know this is going to vary wildly but ours starts out at ~180mb and goes up to about 400mb and just kinda hangs out there. i was wondering if some more aggressive garbage collection may help and if so how i should figure out tuning that
[20:37:05] fryguy: tycoon177: any particular reason why you are optimizing for memory use?
[20:37:14] Exuma: If I want to delete the datatbase in between each test, would it be advisable in `setup do; end` to do: `ActiveRecord::Base.subclasses.each(&:delete_all) `
[20:37:35] Exuma: is that the 'preferred way'. i dont have many tests, but i need it clear between each test because its testing complicated line items/ledger entries
[20:37:49] Exuma: and theyre accumulative so other line items would affect balances if it werent cleared out
[20:38:02] orbyt_: has joined #RubyOnRails
[20:39:08] tycoon177: fryguy: low ram machine until next month :) right now we're running 2 instances on a 2gb system which is fine for our use case at the moment, and we're going to up this to at least 4gb when we move the server from our building to a data center, but we can do deployments (which run on docker) at often as we want without downtime. So I was just wondering if in the meantime there was something I could do to lessen the memory
[20:40:00] tycoon177: fryguy: i wouldn't normally care about memory usage like this, but on a 2gb system that's also hosting our authentication service, it leaves little overhead for extra memory
[20:40:35] fryguy: this guide is probably helpful: https://collectiveidea.com/blog/archives/2015/02/19/optimizing-rails-for-memory-usage-part-2-tuning-the-gc
[20:40:49] tycoon177: i might take a look if it becomes a problem
[20:41:06] tycoon177: right now we usually have ~500mb of available memory on the host
[20:41:44] nickjj: tycoon177, that sounds about normal
[20:41:56] nickjj: but usually you need to account for double that if you plan to run sidekiq too
[20:42:04] tycoon177: if that's about normal then i won't worry about it and i'll just keep an eye on memory usage
[20:42:07] tycoon177: we don't use sidekiq
[20:42:09] nickjj: since it would have its own memory usage separate from your rails app server
[20:42:37] nickjj: but the whole "start small, grow grow grow... level off" pattern is something i see too
[20:43:14] tycoon177: i might suggest switching to sidekiq though...that looks nice. we use delayedjobs right now
[20:43:24] tycoon177: but if this is all fairly normal, great!
[20:43:40] tycoon177: we do have quite a few models i think
[20:44:09] tycoon177: 105 models it looks like
[20:44:54] nickjj: did you run a rake stats?
[20:45:40] tycoon177: had no idea that was a think
[20:52:57] darkhanb: has joined #RubyOnRails
[21:00:05] bijan_: has joined #RubyOnRails
[21:01:55] reber: has joined #RubyOnRails
[21:05:06] brewops: has joined #RubyOnRails
[21:06:31] brewops: General question regarding puma, bundled ruby (with the code release) and the master process if someone has a few minutes.
[21:06:57] sidx64: has joined #RubyOnRails
[21:09:18] mtkd: has joined #RubyOnRails
[21:10:51] optimus55: has joined #RubyOnRails
[21:11:19] optimus55: Hey, I've been looking and can't find a solution. Does anyone know how to get controller helpers visible in minitest controller tests?
[21:19:48] darkhanb: has joined #RubyOnRails
[21:27:47] Exuma: can someone explain how the hell TestCase works. this is so gdam frustrating
[21:27:56] Exuma: it is like making records in the DB yet the DB is entirely empty
[21:28:02] Exuma: ive double checked database.yml
[21:28:22] Exuma: its saying it creates records, but if I put a binding.pry in there after something is created, and refresh DB it is empty
[21:32:36] workmad3: has joined #RubyOnRails
[21:38:39] Rodya__: has joined #RubyOnRails
[21:40:22] tycoon177: brewops: don't ask to ask, just ask and if someone is able to help, they will :)
[21:40:54] brewops: Sounds good, I've gotta pop out for a second but I'll be back
[21:40:55] tycoon177: Exuma: not familiar with testcase specifically, but most testing frameworks clean up after themselves
[21:42:52] mikecmpbll: has joined #RubyOnRails
[21:43:03] riotjones: has joined #RubyOnRails
[21:47:05] workmad3: has joined #RubyOnRails
[22:07:13] quazimodo: has joined #RubyOnRails
[22:07:20] hahuang65: has joined #RubyOnRails
[22:09:03] amperry: has joined #RubyOnRails
[22:10:49] amperry: Hey folks, git cloned a repository into a new host and am having trouble getting 'bundle install' to work. I get the error: "An error occurred while installing ffi (1.9.21), and Bundler cannot continue. Make sure that `gem install ffi -v '1.9.21'` succeeds before bundling." and I can't get `gem install ffi -v '1.9.21'` to work, either.
[22:11:25] amperry: it tells me to check a temp file which does not exist for more detail.
[22:12:09] quazimod2: has joined #RubyOnRails
[22:17:49] cnk: has joined #RubyOnRails
[22:19:00] s2013: has joined #RubyOnRails
[22:20:12] Omnilord: amperry, is the host windows with ruby 2.5.0?
[22:20:36] amperry: nope, ubuntu
[22:20:52] amperry: ruby is: 2.3.1p112
[22:21:15] amperry: ubuntu is 16.04.1
[22:28:27] amperry: although it seems like this answer does the trick: https://stackoverflow.com/a/48790761
[22:28:43] Rodya_: has joined #RubyOnRails
[22:29:55] tycoon177: amperry: that would explain it! a lot of errors with native libs stem from dev libraries
[22:32:57] quazimod1: has joined #RubyOnRails
[22:36:45] amperry: tycoon177: it seems unfortunate, but ultimately inevitable, that one needs to issue (multiple) administrative commands to enable what is (at least in part) a package manager to succeed.
[22:36:50] amperry: but yes, that did it.
[22:37:20] tycoon177: i am personally glad that it fails instead of trying to fetch something like that itself
[22:37:31] tycoon177: i want to be in control of what packages are installed on my system :)
[22:40:38] amperry: I get it, it just becomes frustrating, especially when the error messages are not informative :(
[22:41:19] egray: has joined #RubyOnRails
[22:42:36] quazimod1: has joined #RubyOnRails
[22:45:33] quazimod3: has joined #RubyOnRails
[22:48:04] quazimodo: has joined #RubyOnRails
[22:50:34] orbyt_: has joined #RubyOnRails
[22:52:28] quazimodo: has joined #RubyOnRails
[22:54:08] gambl0re: has joined #RubyOnRails
[22:56:31] cnk: has joined #RubyOnRails
[23:02:21] Rodya_: has joined #RubyOnRails
[23:08:56] kapil___: has joined #RubyOnRails
[23:17:10] NoGodDamnIdea: has joined #RubyOnRails
[23:31:51] emachnic: has joined #RubyOnRails
[23:32:23] orbyt_: has joined #RubyOnRails
[23:46:36] Rodya_: has joined #RubyOnRails
[23:49:22] FCser: hmm I have development environment config.action_mailer.delivery_method :test (restarted server) but it fails with “Connection refused” and is trying to send mail to localhost:25 - the :test method should just log mails to the console?
[23:50:09] s2013: has joined #RubyOnRails
[23:50:40] Rodya_: has joined #RubyOnRails
[23:51:00] uks: has joined #RubyOnRails
[23:53:20] fryguy: fcser: maybe this is relevant https://stackoverflow.com/questions/10961982/actionmailer-sending-real-emails-in-test-mode-how-to-turn-off
[23:53:34] Rodya_: has joined #RubyOnRails
[23:55:57] quazimodo: has joined #RubyOnRails
[23:58:59] bijan_: has joined #RubyOnRails