« Back to channel list

#RubyOnRails - 07 May 2018

« Back 1 day Forward 1 day »
[00:01:50] dipnlik: has joined #RubyOnRails
[00:18:18] alfiemax: has joined #RubyOnRails
[00:27:09] conta: has joined #RubyOnRails
[00:29:55] Linuus`: has joined #RubyOnRails
[01:09:47] Linuus`: has joined #RubyOnRails
[01:14:56] GodFather: has joined #RubyOnRails
[01:19:17] conta: has joined #RubyOnRails
[01:20:08] orbyt_: Radar I have something running via a Rake task. A local node.js server is emitting an event every 5 seconds and i can see these events being printed by the running rake task. I also see that I have access to my models.
[01:20:15] orbyt_: So how does something like this work in production?
[01:20:44] orbyt_: Eg this task is not started when I normally start my rails server
[01:20:58] orbyt_: it's only started after running rails ws:start (my task)
[01:22:49] alfiemax: has joined #RubyOnRails
[01:33:17] Radar: orbyt_: [09:36:54] <Radar> Probably in a separate Ruby process monitored by something like systemd/upstart
[01:48:17] conta: has joined #RubyOnRails
[01:50:38] Linuus`: has joined #RubyOnRails
[01:52:31] alfiemax: has joined #RubyOnRails
[01:57:58] qyliss: has joined #RubyOnRails
[02:14:41] Puffball: has joined #RubyOnRails
[02:15:11] alfiemax: has joined #RubyOnRails
[02:26:46] conta: has joined #RubyOnRails
[02:32:35] Linuus`: has joined #RubyOnRails
[02:40:44] kapil___: has joined #RubyOnRails
[02:41:36] vedu_: has joined #RubyOnRails
[02:46:14] alfiemax: has joined #RubyOnRails
[02:52:13] _3dwardsharp: has joined #RubyOnRails
[02:56:17] Saukk: has joined #RubyOnRails
[03:00:14] ebsen: has joined #RubyOnRails
[03:09:33] Technodrome: has joined #RubyOnRails
[03:13:31] conta: has joined #RubyOnRails
[03:16:33] Linuus`: has joined #RubyOnRails
[03:37:30] alfiemax: has joined #RubyOnRails
[03:40:50] Technodrome: has joined #RubyOnRails
[03:47:03] alfiemax: has joined #RubyOnRails
[03:54:15] Linuus`: has joined #RubyOnRails
[03:54:42] conta: has joined #RubyOnRails
[04:00:18] tomoyuki28jp: has joined #RubyOnRails
[04:00:37] tomoyuki28jp: How can I automatically reload chrome when I edit a file?
[04:01:17] tomoyuki28jp: I think guard-livereload is not maintained any more.
[04:02:59] sevenseacat: has joined #RubyOnRails
[04:04:40] Jonson: has joined #RubyOnRails
[04:31:51] apeiros: has joined #RubyOnRails
[04:39:14] Linuus`: has joined #RubyOnRails
[04:57:15] jane_booty_doe: has joined #RubyOnRails
[05:07:53] conta: has joined #RubyOnRails
[05:13:17] reber: has joined #RubyOnRails
[05:17:27] Linuus`: has joined #RubyOnRails
[05:28:58] conta: has joined #RubyOnRails
[05:30:04] roamingdog: has joined #RubyOnRails
[05:34:28] Linuus`: has joined #RubyOnRails
[05:50:20] _3dwardsharp: what version of rails are you using?
[05:50:59] ur5us: has joined #RubyOnRails
[05:59:54] eckhardt: has joined #RubyOnRails
[06:09:24] mondongo: has joined #RubyOnRails
[06:09:31] alfiemax: has joined #RubyOnRails
[06:09:39] kies^: has joined #RubyOnRails
[06:17:29] kapil___: has joined #RubyOnRails
[06:24:12] Linuus`: has joined #RubyOnRails
[06:29:28] conta: has joined #RubyOnRails
[06:38:35] Linuus`: has joined #RubyOnRails
[06:42:56] schneider-: has joined #RubyOnRails
[07:14:24] elcms: has joined #RubyOnRails
[07:19:06] bipul: has joined #RubyOnRails
[07:24:36] bipul: Hi, I would like to know? How ruby gem is different from rvm(ruby version management) ?
[07:28:57] dionysus69: has joined #RubyOnRails
[07:33:55] schneider-: has joined #RubyOnRails
[07:43:14] schneider-: has joined #RubyOnRails
[07:43:45] ur5us: has joined #RubyOnRails
[07:44:15] dminuoso: ^- being answered in #ruby
[07:46:52] dionysus69: I got a problem
[07:47:27] dionysus69: I had two objects created in system, one could have gone through but the other should have been blocked
[07:47:44] dionysus69: well, both went through, that's a typical case for race condition right?
[07:49:22] Linuus`: has joined #RubyOnRails
[07:52:35] schneider-: has joined #RubyOnRails
[07:57:49] tbuehlmann: dionysus69: what objects?
[07:58:04] dionysus69: money transaction objects let's say
[07:58:21] dionysus69: so it's critical it doesn't happen that way
[08:01:51] tbuehlmann: plain old ruby objects? activerecord objects? banana objects?
[08:01:54] schneider-: has joined #RubyOnRails
[08:02:18] dminuoso: dionysus69: STM.
[08:02:53] elcms: has joined #RubyOnRails
[08:02:58] dionysus69: dminuoso: that means?
[08:03:09] dionysus69: tbuehlmann: it involves quite a bit one sek let me explain
[08:03:30] dionysus69: so the approval has a conditional
[08:03:31] dminuoso: dionysus69: Does this happen across threads? across processes?
[08:03:33] dminuoso: across servers?
[08:03:37] dminuoso: across server farms?
[08:03:47] dionysus69: across processes and threads *
[08:04:17] dionysus69: puma has 4 workers and 12 threads
[08:04:39] dionysus69: ok, do I just revert it back to 1 worker before I resolve this issue?
[08:05:06] dionysus69: this is an unexpected behavior, I changed puma to multi worker setup a week ago or something
[08:07:06] tbuehlmann: dionysus69: you typing or was that it?
[08:08:16] conta: has joined #RubyOnRails
[08:08:45] dionysus69: tbuehlmann: the conditional check is checking three conditions, if any of them is true, than transaction is not approved. #1 it queries the db to count number of transactions in past 24 hours #2 compares that number to rails_settings_cached integer, #3 checks if amount of transaction exceeds rails_settings_cached float value, #4 last condition is that it checks if there's an enough balance on remote server so it queries remote server to
[08:09:18] dionysus69: if any of those three conditions is true, tx is declined, but 2 txs got created at the same second
[08:09:34] dionysus69: so something went nuts in the process
[08:09:53] tbuehlmann: do you use any kind of locking?
[08:10:11] dionysus69: to avoid this, should I make this conditional sleep for random number of seconds to make overlaps very unlikely?
[08:10:45] dionysus69: I use aasm and after tx is approved, after_commit events are fired
[08:11:10] schneider-: has joined #RubyOnRails
[08:11:13] dionysus69: which then just fires the transaction
[08:11:37] tbuehlmann: did I just read you're dealing with money transactions without any locking using floats?
[08:11:58] dionysus69: hmm what kind of locking do you mean ? :)
[08:12:37] tbuehlmann: like, database locking
[08:13:31] dionysus69: this ? http://api.rubyonrails.org/classes/ActiveRecord/Locking/Pessimistic.html
[08:15:12] tbuehlmann: if you don't know anything about that topic, I'd rather not give you any advise on it and instead suggest getting help for that elsewhere
[08:15:41] dminuoso: 10:10 dionysus69 | to avoid this, should I make this conditional sleep for random number of seconds to make overlaps very unlikely?
[08:15:56] dminuoso: The mere fact that you just had this line of thought suggests you have no clue how to do concurrency safely.
[08:16:19] dionysus69: well, yea just reverted puma to single worker
[08:16:26] dionysus69: until I get this right
[08:16:33] dminuoso: Single process allows you to use STM to make this easy.
[08:16:49] dminuoso: But the second you need to synchronize across processes (or even servers) things become tricky.
[08:17:35] s2013: has joined #RubyOnRails
[08:18:14] dionysus69: dminuoso: is mutex applicable to processes too and not just threads?
[08:18:17] vedu_: has joined #RubyOnRails
[08:18:43] dminuoso: dionysus69: Use STM if you can.
[08:18:45] dminuoso: dionysus69: And no.
[08:18:51] dminuoso: dionysus69: Unless you use shmem.
[08:18:57] dminuoso: Which I dont know if you even can in Ruby
[08:19:21] dionysus69: damn it, ok thanks, I'll look into STM :)
[08:19:38] dminuoso: dionysus69: You could kind of abuse the database to do the same, but you should probably understand STM first
[08:19:39] tbuehlmann: there are other simple solutions like advisory locks in postgres, but really, get help on that topic. and not from an IRC channel
[08:20:03] dminuoso: dionysus69: THe best thing you can do is _not talk about locks_
[08:20:16] dionysus69: haha ok thanks allot both of you :)
[08:20:29] schneider-: has joined #RubyOnRails
[08:29:57] schneider-: has joined #RubyOnRails
[08:31:17] qyliss: has joined #RubyOnRails
[08:34:38] marr: has joined #RubyOnRails
[08:39:18] schneider-: has joined #RubyOnRails
[08:48:38] schneider-: has joined #RubyOnRails
[08:57:34] drale2k_: has joined #RubyOnRails
[08:57:52] schneider-: has joined #RubyOnRails
[08:58:59] ur5us: has joined #RubyOnRails
[09:03:24] elcms: has joined #RubyOnRails
[09:08:19] sameerynho: has joined #RubyOnRails
[09:08:50] Torrone: has joined #RubyOnRails
[09:09:21] Torrone: Hello, is there any detailed tutorial/docs for capistrano's parallel deployment that you know of?
[09:11:13] drale2k_: has joined #RubyOnRails
[09:15:46] roamingdog: has joined #RubyOnRails
[09:15:54] Ergo: has joined #RubyOnRails
[09:16:41] jane_booty_doe: How do I debug strong parameters always returning `permitted: false`
[09:17:27] jane_booty_doe: I disabled all pundit policies, validation in the model and removed every unique index
[09:18:22] tbuehlmann: jane_booty_doe: well, do you permit any params?
[09:19:47] jane_booty_doe: tbuehlmann, yes `params.require(:account).permit(:username, :provider_id, :provider)`
[09:20:12] jane_booty_doe: params are {"utf8"=>"✓", "authenticity_token"=>"uQdvd9Ma05TGZlLa8mBTHNHtXNf8Wczvp0O5ZxWdDSNZd3GV8sKJVIoLQb371ypMMB8g4VIt07FZ0aG2RVKp9Q==", "account"=><ActionController::Parameters {"username"=>"test", "provider_id"=>"1", "provider"=>"foo"} permitted: false>, "commit"=>"Save Account", "controller"=>"accounts", "action"=>"create"}
[09:21:11] tbuehlmann: okay, and you then use the resulting object later on, right?
[09:21:13] jane_booty_doe: I run into the dumbest problems I swear
[09:22:46] jane_booty_doe: tbuehlmann, Yes just the standard way of doing it. Account.new in the new method and Account.new(account_params) in create
[09:23:13] tbuehlmann: and what error do you get? can you gist the code?
[09:25:00] vedu_: has joined #RubyOnRails
[09:25:06] DrYockel: has joined #RubyOnRails
[09:26:04] jane_booty_doe: tbuehlmann, there's no form validation errors, create just returns the else block for @account.save and renders edit. can I use byebug to dig deeper somehow?
[09:29:02] jane_booty_doe: wish the server logs weren't so worthless
[09:45:36] tbuehlmann: sure, just place a debugger in the else branch and check the object
[09:48:08] vedu_: has joined #RubyOnRails
[09:59:19] kapil___: has joined #RubyOnRails
[10:07:20] deramius: has joined #RubyOnRails
[10:10:07] za1b1tsu: has joined #RubyOnRails
[10:12:25] za1b1tsu: Hello, I'm using omniauth and I need instead to send instead of rediret_uri an redirect_url, and instead of 'code' for response_type, 'implicit' or 'authorization_code'. I managed to change redirect_uri to redirect_url by overwriting the request_phase method. But I can't find out how to change the response_type, from my googling it seems that I can't change the response_type, it must be remain to 'code'.
[10:12:30] ur5us: has joined #RubyOnRails
[10:13:40] za1b1tsu: I really dont undestand why... I'm missing something, I have to use something else? This is what I'm getting from the provider : "There was an error: You must supply a valid response type; supported types include implicit and authorization_code"
[10:14:10] za1b1tsu: in there documentation is mentiond as well, that response_type must be set to implicit or authorization_code
[10:19:41] za1b1tsu: it says here in the documentation https://tools.ietf.org/html/draft-ietf-oauth-v2-20#section-4.1.1 that response_type MUST be set to code. So this is the problem of the provider for breaking convetions?
[10:23:41] conta: has joined #RubyOnRails
[10:34:49] alfiemax: has joined #RubyOnRails
[10:37:10] conta: has joined #RubyOnRails
[11:03:00] jottr: has joined #RubyOnRails
[11:16:40] Cavallari: has joined #RubyOnRails
[11:16:58] mostlybadfly: has joined #RubyOnRails
[11:19:45] Cavallari: has joined #RubyOnRails
[11:27:57] jottr: has joined #RubyOnRails
[11:42:57] samosaphile: has joined #RubyOnRails
[11:46:06] hammer065: has joined #RubyOnRails
[11:51:15] S007: has joined #RubyOnRails
[12:07:48] samosaphile: Hi, could someone please help me? When I run rails server I get a [BUG] Bus Error at 0x0eb5c60b showing a ton of control frame, ruby level backtrace and other runtime info.
[12:08:24] samosaphile: at the end of log, says [NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html Aborted (core dumped)
[12:11:20] dminuoso: samosaphile: Please gist the _entire_ output of the dump.
[12:11:27] dminuoso: samosaphile: Do not cut anything away, include the whole thing.
[12:15:06] samosaphile: I think the cause of the issue might be or have something to do with my setup, not the usual MBP which seem most rails dev's but running on an ubuntu chroot on an arm chromebook via crouton. The thing is, I've had this work before, so I know it is possible. I'd hate to have to switch languages/frameworks for my project to something like flask/nodejs as I really like ruby and rails. I've latest ruby/rails installed. Perhaps i
[12:15:15] samosaphile: run more stably on arm?
[12:15:32] dminuoso: samosaphile: If you do not provide the information I just asked you for, I cannot help you in any way whatsoever.
[12:15:32] KeyJoo: has joined #RubyOnRails
[12:16:00] samosaphile: dminuoso: sorry am a noob and the log is really long, how do I do that?
[12:16:14] dminuoso: samosaphile: Do you have the info in a log file or just in STDOUT?
[12:16:53] samosaphile: It just shows in terminal like in bash? (STDOUT?)
[12:17:31] dminuoso: samosaphile: Just select it, it will be automatically copied. Use the middle mouse button to paste it somewhere.
[12:17:40] dminuoso: (On most terminal emulators that will work)
[12:17:41] samosaphile: I don't know how to create a log file .. do I do like rails server >> logfile.txt or something?
[12:18:13] dminuoso: samosaphile: Just copy it from the output and paste it here https://gist.github.com/
[12:18:26] samosaphile: dminuoso: problem is my terminal won't let me scroll up, so I can't seem to highlight complete log thing....
[12:18:38] samosaphile: any other way / solution?
[12:18:53] dminuoso: samosaphile: Can you reproduce the issue?
[12:19:53] samosaphile: what do you mean, which issue?
[12:20:04] dminuoso: samosaphile: The crash.
[12:20:41] samosaphile: yeah, multiple times...
[12:21:34] dminuoso: samosaphile: `rails s 2> crash.log`
[12:25:36] dipnlik: has joined #RubyOnRails
[12:27:40] samosaphile: wierd, usually doing > crash.log works, but it isn't writing anything in the file :/
[12:28:47] dminuoso: samosaphile: > only redirects stdout
[12:28:56] dminuoso: samosaphile: Im sure that the bug splat screen prints to stderr
[12:29:02] dminuoso: samosaphile: Which is why I mentioned "2>"
[12:29:13] dminuoso: (which is bash syntax for `redirect stderr to`)
[12:29:57] dminuoso: samosaphile: > is I think fuly equivalent to 1> which is `redirect stdout to`
[12:35:13] samosaphile: dminuoso: https://paste.linux.community/view/raw/265af21f
[12:35:53] dminuoso: samosaphile: File a bug report for bootsnap.
[12:37:32] dminuoso: samosaphile: https://github.com/Shopify/bootsnap/issues/67
[12:38:17] dminuoso: samosaphile: I mean I agree with the asssessment there, I think it might be a ruby bug
[12:38:27] dminuoso: But it's really hard to tell without debugging with gdb
[12:45:13] samosaphile: Is bootsnap new or something to ruby or rails? Because I swear I had this working like last last year with no errors, seems like new bug to me but people are reporting bugs as early as last year there, so not sure anymore what's going on...
[12:46:27] jottr: has joined #RubyOnRails
[12:59:01] samosaphile: Oh wow lol, actuallying doing fig's suggestion fixed it! :o) commenting out require 'bootsnap/setup'
[13:00:33] samosaphile: dminuoso: How do I DISABLE_SPRING=true in env var?
[13:02:37] schneider1: has joined #RubyOnRails
[13:02:49] samosaphile: nvm, https://stackoverflow.com/questions/34316585/how-to-run-rails-console-on-production-without-executing-spring/34316966?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
[13:03:25] context: dont put spring in your global dependncy list?
[13:04:06] context: move it to your dev,test group and dont even have it installed in production
[13:04:46] argoneus_: has joined #RubyOnRails
[13:05:47] samosaphile: context: how do I do that? complete noob here
[13:06:13] deramius: has joined #RubyOnRails
[13:07:04] context: samosaphile: but it in the group block
[13:07:42] context: the default gemfile already has blocks in there
[13:07:50] context: and it puts spring int here by default as well i thought
[13:07:50] samosaphile: i don't even know what a group block is or where to find it
[13:07:51] jottr: has joined #RubyOnRails
[13:07:52] mjolnird: has joined #RubyOnRails
[13:08:09] context: in the Gemfile
[13:09:05] arielserafini_: has joined #RubyOnRails
[13:09:20] bphogan_: has joined #RubyOnRails
[13:09:31] webdestroyaz: has joined #RubyOnRails
[13:11:16] chridal: has joined #RubyOnRails
[13:11:35] Sirecote: has joined #RubyOnRails
[13:11:35] w0rd-driven: has joined #RubyOnRails
[13:11:42] Scient: has joined #RubyOnRails
[13:13:24] gambl0re: has joined #RubyOnRails
[13:13:53] samosaphile: context: i actually don't see any spring in my gemfile
[13:15:20] samosaphile: spring-watcher-listen
[13:16:19] samosaphile: anyways, Thanks so much for the help context + dminuoso ! was stuck on this for days...
[13:17:21] samosaphile: has left #RubyOnRails: ()
[13:17:26] kies^: has joined #RubyOnRails
[13:18:43] dionysus69: has joined #RubyOnRails
[13:25:55] DTZUZO: has joined #RubyOnRails
[13:27:16] ule: has joined #RubyOnRails
[13:27:16] alfiemax: has joined #RubyOnRails
[13:33:40] d3ramius: has joined #RubyOnRails
[13:34:40] alfiemax: has joined #RubyOnRails
[13:46:17] GodFather: has joined #RubyOnRails
[13:50:08] samosaphile: has joined #RubyOnRails
[13:57:26] kurko_: has joined #RubyOnRails
[13:58:01] marr: has joined #RubyOnRails
[13:59:07] alfiemax: has joined #RubyOnRails
[14:00:27] j0bk: has joined #RubyOnRails
[14:03:59] samosaphile: But question, everytime I do 'rails new myapp' .. It'll always generate a boot.rb file in config, with require 'bootsnap/setup' written in it. Is there anyway to configure so that it does not write that every time making a new app so I don't have to keep manually editing it everytime and if so, how?
[14:09:06] sevenseacat: samosaphile: you can pass the --skip-bootsnap option when running rails new
[14:09:59] samosaphile: also, could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
[14:10:02] Technodrome: has joined #RubyOnRails
[14:10:40] samosaphile: sevenseacat: alright
[14:13:00] samosaphile: nvm, did: sudo service postgresql start
[14:16:40] samosaphile: FATAL: database "scrapertutorial_development" does not exist :S
[14:17:23] sevenseacat: did you create it?
[14:18:39] Tempesta: has joined #RubyOnRails
[14:20:33] jokke: has joined #RubyOnRails
[14:21:19] samosaphile: don't think so, was just following this: https://blog.devcenter.co/web-scraping-with-ruby-on-rails-67c5d3d133ff apparently should get 'yay you're rails' page but i just get ActiveRecord::NoDatabaseError not sure if this guys tutorial is wrong or what
[14:21:23] jokke: according to EU law you now need to inform your users that you're using cookies on a site. Are there any easy methods for opt-in session usage for rails?
[14:22:37] jokke: as in: only use a session cookie if the user has confirmed that it's okay to do so via an ajax request to some route or sth
[14:22:48] IanMalcolm: has joined #RubyOnRails
[14:23:04] context: i think its more typical sites just say 'hi. we use cookies' not make it an option
[14:23:27] context: that sounds like a lot of unneeded work to maintain multiple session stores. but.. have fun
[14:23:53] jokke: well all sites i've seen have a button you'll have to click to "dismiss" the banner
[14:24:04] jokke: and until you do, no cookies are set
[14:24:27] sevenseacat: I don't think the last part is correct
[14:24:44] alfiemax: has joined #RubyOnRails
[14:25:37] samosaphile: ok, good, so not just me then
[14:32:34] chouhoulis: has joined #RubyOnRails
[14:38:59] za1b1tsu: has joined #RubyOnRails
[14:47:29] jokke: yeah you're right
[14:47:32] jokke: just checked
[14:51:25] samosaphile: wierd, is it normal not to have a app/config/routes.rb ? following this tutorial now: http://adrianmcli.com/2015/05/23/rails-scraping-tutorial/ cuz the last time i tried running this code on repl.it got like too many requests error 420, so trying to run it locally now to see if it just repl.it issue or what
[14:51:50] sevenseacat: that file gets generated when you create your rails app.
[14:52:18] samosaphile: not to have app/config/routes.rb when you newly create an app I mean. By default repl.it has it
[14:53:43] samosaphile: ye it should... but I don't when I do 'rails new scraper' locally :|
[14:53:51] sevenseacat: what version of rails?
[14:54:17] sevenseacat: can you gist the output of running 'rails new'?
[14:54:46] samosaphile: Rails 5.2.0, I believe repl.it is using slightly older version, 5.1.x or something
[14:56:04] samosaphile: 'rails new' => No value provided for required arguments 'app_path'
[14:56:23] sevenseacat: no, with the name of the app, like you're creating the app
[14:57:35] tdy: has joined #RubyOnRails
[15:01:51] kurko_: has joined #RubyOnRails
[15:06:36] samosaphile: sevenseacat: https://paste.linux.community/view/raw/b78bb768 <-- the gist output when I run: rails new scraper --skip-bootsnap
[15:07:43] sevenseacat: I see a `create config/routes.rb` line there
[15:08:41] GodFather: has joined #RubyOnRails
[15:09:17] sevenseacat: what issue are you having?
[15:10:01] samosaphile: oh yeah, you're right. guess I got confused because not under /app/ path like it said in tutorial and on repl.it it under app/config/routes.rb too but i guess whether it is under app or not shouldn't matter too much
[15:10:12] sevenseacat: no its not, on repl.it
[15:10:18] sevenseacat: its in config/, not app/
[15:12:49] samosaphile: nvm, im going blind
[15:12:59] sevenseacat: seems like the tutorial is dodgy - its never been in app/
[15:13:53] sevenseacat: if you're just getting started with rails, i'd recommend the official guides over some random blog post
[15:25:30] alfiemax: has joined #RubyOnRails
[15:27:33] fox_mulder_cp: has joined #RubyOnRails
[15:40:16] cagomez: has joined #RubyOnRails
[15:40:28] jcarl43: has joined #RubyOnRails
[15:43:53] Fernando-Basso: has joined #RubyOnRails
[15:44:23] cagomez: has joined #RubyOnRails
[15:49:23] mcr1: has joined #RubyOnRails
[15:49:50] dionysus69: has joined #RubyOnRails
[15:50:23] mcr1: many sites, (stackoverflow, many blogs) let you add tags to your post. You type in a keyword, and it gets added to a list... great. They get called "tag"s, which is horribly confusing with html tags, css tags, etc. I'm looking for a rails library with jQuery front end that would do this... Maybe it's part of bootstrap already, if I just knew what to search for.
[15:50:35] dionysus69: what are some of the tools I can use to make attack replications of let's say 20-50 requests per second
[15:51:06] dionysus69: I am trying to recreate the race condition problem I had earlier
[15:53:29] elcms: has joined #RubyOnRails
[15:55:09] eckhardt: has joined #RubyOnRails
[15:59:18] apeiros_: has joined #RubyOnRails
[15:59:21] Inside: has joined #RubyOnRails
[15:59:42] Inside: Why oh why is process a reserved name.
[16:00:17] Torrone: has joined #RubyOnRails
[16:00:58] KeyJoo: has joined #RubyOnRails
[16:01:56] Torrone: Hello, I'm having an issue with my capistrano deployment, I'm setting :rvm_custom_path to '~/.rvm/bin/rvm' but when the deploy task runs the bundler I get: bash: /bin/rvm: No such file or directory (I'm not going to symlink because this looks related to some other issues). thoughts?
[16:02:42] Inside: There's also a #capistrano, but it looks pretty dead
[16:02:58] Torrone: Inside, indeed, just joined
[16:03:09] Torrone: I'll post there as well
[16:03:14] Torrone: it won't hurt
[16:03:31] tycoon177: I am having issues with rubyzip in my rails application. Sometimes, the zip files that are generated cannot be opened on osx, with an error of operation not permitted. I found this relevant issue on github https://github.com/rubyzip/rubyzip/issues/249. I was wondering if anyone else has run into this issue or if there is another library that I can use to zip these files in rails
[16:03:49] conta: has joined #RubyOnRails
[16:04:01] tycoon177: the files that I am zipping, in case it matters, are all photos. There are generally 15-25 of them
[16:06:25] Inside: Torrone: what's the whole log look like>?
[16:06:50] Torrone: Inside, it looks ok until bundle:install
[16:07:34] Torrone: I was checking that cap was using the correct shell and user but it looks ok too
[16:09:13] vovs03: has joined #RubyOnRails
[16:22:14] schneider1: has joined #RubyOnRails
[16:32:39] GodFather: has joined #RubyOnRails
[16:33:25] dipnlik: has joined #RubyOnRails
[16:41:21] dminuoso: mcr1: Libraries like selectize and others have some machinery built in
[16:41:32] dminuoso: mcr1: But honestly you should probably write it yourself first.
[16:41:51] dminuoso: It's easy, and usually better to write your own rather than to and force some weirdly and badly written JS library to do your buddin.
[16:42:02] dminuoso: woah grammar.
[16:42:14] dminuoso: It's easy, and usually better to write your own rather than to force some weirdly and badly written JS library to do your bidding.
[16:47:27] Exagone313: has joined #RubyOnRails
[16:50:25] samosaphile: are you sure about that dminuoso ? while i agree plain code without libraries is always better, whenever i ask anyone how to build a custom web scrapper everyone suggests libraries (e.g. cheerio for nodejs, scrapy/bs4 for python, etc) :/ im starting to begin to think it is impossible to unless you've like 15 years of experiance :/
[16:50:54] agent_white: has joined #RubyOnRails
[16:51:10] dminuoso: samosaphile: The vast majority of webapp problems are not that hard.
[16:51:31] dminuoso: samosaphile: You quickly fall into the "I have a problem, now I need an npm package to solve it" devils circle.
[16:52:01] dminuoso: bs4 or similar things are great for a lot of things, but they shouldn't mean "you dont need css"
[16:52:09] dminuoso: bs4 is just "I dont want to style everything from hand"
[16:53:41] eckhardt: has joined #RubyOnRails
[16:56:13] mcr1: selectize.js looks exactly what I want... I hate re-inventing things....
[16:56:37] Saukk: has joined #RubyOnRails
[16:59:15] samosaphile: I don't want to but that's what most tell me to use. I'd rather do it library less because I know even myself tend to avoid installing programs which have many dependencies. To give an specific example of what I am talking about, all I wanna do is scrape a specific field from JSON API output here: http://info.server.cnc-online.net/
[16:59:54] samosaphile: I tried this in nodejs: https://repl.it/repls/WigglyDarkorchidLaboratory but console.log(body) prints everything
[17:00:14] samosaphile: don't know how to make it only output 1 field
[17:00:56] dminuoso: samosaphile: The big problem with npm is the absolute horrid quality of code.
[17:01:20] dminuoso: Added with the potential to pull in big trees of transitive dependencies which webpacks shitty shaking cant get rid of because JS committee folks are idiots.
[17:02:52] dminuoso: samosaphile: I wouldn't be using node to begin with. The english dictionary has not enough words to describe how wrong it is to be using node at all.
[17:03:27] lupine: YEAHHHHHHHHHHHHHHH
[17:05:11] dang`r`us: nooooode *shakefist*
[17:05:15] samosaphile: lol...tbh, am abit confused what to use exactly... I just randomly found some code that did something and made it work. it is a long story but basically what am trying to do is...
[17:05:35] samosaphile: i wanna build something similar to like this http://ggtracker.com/landing_tour but for another game. except I don't have a replay parser. So trying to just build something which scrapes data or stats about other players from other sites. So need a web scraper / crawler. Hence searching / looking at this stuff.
[17:05:54] samosaphile: I remember starting some official guides awhile back but kept losing motivation / interesting and quiting because they were all like very basic stuff. Like how create a form or article. I suppose I just lack the patience, no doubt fundamentals are important.
[17:06:08] dminuoso: samosaphile: Well whatever the task is, node is almost certainly the wrong choice. Just because you _can_ use JavaScript doesn't mean you should.
[17:06:18] dminuoso: A language should be picked because it has some great things over other languages.
[17:06:19] samosaphile: trying to scrape this: http://shatabrick.com/cco/zh/index.php?g=zh&a=1
[17:06:29] dminuoso: JS simply has nothing except a monopoly on front end.
[17:06:33] samosaphile: also get user server activity from: https://cnc-online.net/en/ they have json api output here: http://info.server.cnc-online.net/
[17:06:44] samosaphile: But not sure how to only read partially from that, only need stuff from 'generalszh' and not too sure how to transform or structure this data into something else.
[17:06:57] samosaphile: maybe something that can also crawl/scrape from gentool.net/data/zh but no api ... for example: http://gentool.net/data/zh/2018_04_April/29_Sunday/-DoMiNaToR-_AKEBJEMUHDDB/21-09-07_3v3_czuczinh_suczysko_sabonis_DoMiNaTo_gumbo_flo1988.txt
[17:07:08] samosaphile: get info/data like how often a player is active in a month, how game games a player played in a day/week, how long these were, the time and type of players this player plays most often with, favorite/most played map and game mode or type, etc.
[17:07:10] alfiemax: has joined #RubyOnRails
[17:07:20] samosaphile: Then somehow figure out a way to graph all this or combine it. probably need a database too somewhere.
[17:07:55] schneider1: has joined #RubyOnRails
[17:08:50] Inside: mcr1: Have you heard of our good & fair lord, npm leftpad?
[17:10:48] samosaphile: dminuoso: I originally started with python because it seems scraping like tasks were mostly associated with it, then somewhere somehow got stuck, then switched to ruby/rails ... then switched to JS/node because I noticed there were all these nice visualization / graphing front end libraries but then got stuck there too xD
[17:11:19] samosaphile: I keep switching .. can't really make up my mind
[17:11:53] samosaphile: all i know is this shouldn't be that hard because people have done it with all and any languages
[17:14:23] samosaphile: not sure how people go from hello world and for loops to actually building stuff ... i tried stuff like codecademy but when it comes to actually building everything is so hard
[17:15:40] samosaphile: I can't even figure out if it's just this code or me: http://railscasts.com/episodes/190-screen-scraping-with-nokogiri?view=asciicast pretty much everything is broken and nothing works ... atleast I got that nodejs code to do something lol
[17:16:06] samosaphile: only the first part of that ruby works
[17:16:15] samosaphile: none of the rest for me
[17:16:18] mcr1: Inside, "npm *leftpad*?
[17:17:11] schneider1: has joined #RubyOnRails
[17:17:37] kurko_: has joined #RubyOnRails
[17:18:27] samosaphile: I don't think JS is always bad tho, for example, this is a really well made JS app: https://chrome.google.com/webstore/detail/jstorrent/anhdpjpojoipgpmfanmedjghaligalgb?hl=en
[17:19:36] dminuoso: samosaphile: Name one feature that makes "JS" really good.
[17:19:43] dminuoso: What's the one selling point of JS?
[17:19:53] dminuoso: Other than "its on every browser"
[17:19:55] samosaphile: here is code for it: https://github.com/kzahel/jstorrent
[17:20:26] dminuoso: samosaphile: It's particularly interesting because all the "good things" are so common that almost every language in the past 30 years has those features. And those languages consider them basics. They are not special.
[17:20:33] dminuoso: JavaScript lacks special things.
[17:20:42] dminuoso: samosaphile: Here's something fancy for you to try out
[17:22:02] samosaphile: dminuoso: it's not that it just runs in every browser, ever since google v8 engine, it's so fast: https://cdn-images-1.medium.com/max/800/0*I8f5ai1pVPieV7hK.png
[17:22:19] dminuoso: samosaphile: ["1", "2", "3"].map(parseInt)
[17:22:28] dminuoso: samosaphile: Think about what a sane developer would expect this to do.
[17:22:34] samosaphile: make ruby seem slow in comparison
[17:22:34] dminuoso: samosaphile: And then without googling tell me why this behaves this way.
[17:24:03] samosaphile: you don't need to learn two different languages for front and backend
[17:24:48] dminuoso: samosaphile: And therein lies the fault.
[17:24:56] dminuoso: samosaphile: A developer who refuses to learn any other language is worth firing.
[17:25:14] dminuoso: If you're not even open to the idea to learn a second language you can't possibly widen your horizon.
[17:25:35] dminuoso: It restricts you because you start using your screwdriver to put nails in the wall and drill holes with.
[17:26:01] dminuoso: Also it prevents you from seeing how much garbage JavaScript really is.
[17:26:30] schneider1: has joined #RubyOnRails
[17:27:01] samosaphile: who said they're not willing? but maybe they are under time constraints and easier to like stick to 1 thing (for now) then learn several new things at the same time and implement them in an effective matter
[17:27:14] cagomez: has joined #RubyOnRails
[17:27:21] dminuoso: samosaphile: Because you end up with tons of garbage that is costly to maintain.
[17:27:25] samosaphile: I can't code but they say you can implement most algorithms and data structures in any language .. if that's the case, why would language even matter?
[17:27:43] dminuoso: samosaphile: There's plenty of fine languages that can be learned at a fine time.
[17:28:01] dminuoso: samosaphile: And if you cant spend 3 months to learn some tech as a junior developer, then find another job please.
[17:28:27] dminuoso: samosaphile: Okay why do we pick languages at all?
[17:28:29] Liothen: has joined #RubyOnRails
[17:28:30] dminuoso: Why not write raw machine code?
[17:28:45] dminuoso: If I tell you the ELF specification and give you an intel programming handbook you can write programs just fine.
[17:29:24] lupine: can confirm, have done
[17:29:37] lupine: you're being a bit of an arsehole though
[17:29:45] dminuoso: No there's a point to that actually
[17:30:02] lupine: sure, to permit the passage of excreta
[17:30:23] dminuoso: Not really. The point is that we pick languages because they have abstractions that let us not think in machine instructions but in abstract domains.
[17:30:33] dminuoso: We like to think in terms of functions, maybe classes or whatever really.
[17:30:46] cagomez: I have an endpoint I'm POST'ing to. Wether I supply a parameter (key, value) in the Request Body or in the Query String, I can see it in `params` during the controller action. Does Rails treat all parameters (Request body and query string) the same? ie puts them in `params`
[17:30:56] dminuoso: Languages provide tools for abstractions as well as filters for bad programs (parsers and type systems)
[17:31:52] dminuoso: cagomez: Yes. They are considered the same
[17:32:18] cagomez: ok, thanks
[17:32:28] dminuoso: So the question boils down to: What tooling does that language have let us build abstractions or express invariants.
[17:32:30] samosaphile: you keep hating on JS but you realise that's where all the money and rage is now atm, right (or atleast was, not sure what is now, maybe rust)? There's just so much more money and opportunity than say someone who just knows ASM (altho not saying this is completely useless skill, I am sure the meta skills and problem solving ability you learnt while doing that will help better in any language)
[17:32:41] dminuoso: there's no money in JS.
[17:33:34] samosaphile: There is money in design and UX
[17:33:44] dminuoso: samosaphile: If you want to see why, check out the average income of a web developer, and the average income of someone soling ML problems
[17:34:15] dminuoso: I dont know whether there's any other field in software development that is less profitable than web development.
[17:35:14] MrCrackPotBuilde: has joined #RubyOnRails
[17:35:51] schneider1: has joined #RubyOnRails
[17:35:54] MrCrackPotBuilde: has joined #RubyOnRails
[17:36:05] dminuoso: It's a lot of competetion, and you'll always have some moron developer that will underbid you because web development is easy right?
[17:38:00] dminuoso: samosaphile: Luckily my hate on JS is fading. With wasm other languages see an opportunity to finally ship to the browser (compilation to JS is so problematic for many reasons)
[17:39:17] dionysus69: dminuoso: You remember my problem from before? :) I need to recreate it in dev environment, what are standard ways to test lots of requests at once to recreate a race condition
[17:39:26] samosaphile: yes, exactly, languages provide abstraction layers. JS is just a higher level of abstraction, just means it it lowers the level of entry level, don't see how that is a bad thing. Yes, it is easier to write crappy code too, where in languages like C++ it's harder to do because you actually have to handle how the memory works and all. I know coders who started off as JS dev's now working on low level C++ JIT code for emu's and
[17:39:30] lupine: as long as there's an about:config to disable that too :D
[17:39:52] dminuoso: samosaphile: The only thing that doesnt make JS completely terrible is the fact that you can treat functions as first class values easily.
[17:39:55] lupine: it doesn't matter what language you use in the browser, it's all inimical to you
[17:39:58] dionysus69: any tools I need to know about or just a script which does 100.times { the request }
[17:40:05] dminuoso: That's not really a "feature" because almost every language in the past 30 years has that feature as a basic capability but there's that.
[17:40:06] samosaphile: I am not sure they'd of continued and gotten better to that point, if it wasn't made easier for them to begin with
[17:40:57] dminuoso: dionysus69: You can't really recreate race conditions.
[17:42:15] eckhardt: has joined #RubyOnRails
[17:42:18] dminuoso: dionysus69: What solution did you use? Explicit locks? STM?
[17:42:29] samosaphile: also no money in web dev work? are you serious? not sure where you been have you seen the salaries of people coming out of some of these bootcamps (e.g. app academy, hack reactor, etc). Getting 120K+ in SF.
[17:43:40] mlt-: has joined #RubyOnRails
[17:43:41] alfiemax: has joined #RubyOnRails
[17:44:05] dminuoso: samosaphile: You're telling me the average "just out of bootcamp" web developer who can't tell an array apart from a compiler gets about as much as your average facebook or google software engineer?
[17:44:06] samosaphile: not saying deep/machine learning isn't a big deal either or not making money ... but it's allot harder, need phd in CS than like 3 months learning at a bootcamp
[17:44:22] dminuoso: samosaphile: Is that really what you are telling me? Or is that just the advertisement from all those bootcamps that you bought into?
[17:45:08] schneider1: has joined #RubyOnRails
[17:45:22] roamingdog: has joined #RubyOnRails
[17:45:37] d3ram1us: has joined #RubyOnRails
[17:46:59] dionysus69: dminuoso: didn't use anything yet, I just want to see that I can recreate it
[17:47:43] dminuoso: dionysus69: It's not really reliable.
[17:48:00] dionysus69: then how do I know i fixed something if I am not 100% sure of the cause
[17:48:02] dminuoso: dionysus69: You have to verify it with expertise or formal methods.
[17:48:46] dminuoso: dionysus69: After all, if your test suite passes, maybe it just passed because you didn't reproduce the race (in that run)
[17:49:02] dionysus69: I will run it 100 times
[17:49:07] dionysus69: 1000 if it takes it
[17:49:36] dionysus69: until I see an error, and when I fix it, I will run it for whole night and I shouldnt see an error in the morning xD
[17:49:44] dminuoso: dionysus69: Like I said. If it passes, maybe it just passed because you didn't reproduce the race.
[17:50:01] Cache_Money: has joined #RubyOnRails
[17:50:19] dionysus69: something tells me that it won't be hard to reproduce it
[17:50:50] dionysus69: thing is that I had mutliple workers, and I didn't setup any locks in between processes
[17:50:55] dionysus69: so I blame that
[17:51:21] dminuoso: dionysus69: What if your solution just changes the timings so that it drastically decreases the race condition?
[17:51:23] dionysus69: I will still try to reproduce it in a single process though, cause now I am paranoid
[17:52:13] dminuoso: dionysus69: You can't verify a solution to a concurrent problem by just trying it 100 times unless you have good reasons to assume that it *should* trigger.
[17:53:13] dionysus69: well, as I said before I could include a sleep statement for random duration, but tbuehlman didn't really like that idea :D I have no idea where to start so I am just wild guessing, I am going to work on this problem whole day for tomorrow so I need to be ready psychologically ^.^
[17:53:44] alfiemax: has joined #RubyOnRails
[17:54:14] dminuoso: 19:48 dminuoso | dionysus69: You have to verify it with expertise or formal methods.
[17:54:26] schneider1: has joined #RubyOnRails
[17:54:31] dminuoso: If you have the expertise, you wouldn't be asking whether your solution is good.
[17:54:47] dionysus69: is there a way to make an app wide lock on a specific user? so user can't make more than 1 request per second or something
[17:54:50] dminuoso: If you don't have the expertise, you can't design a test that would have the necessary coverage.
[17:54:54] dionysus69: well I don't have expertise I guess, just yet :D
[17:55:30] dminuoso: dionysus69: Do you have a specific question?
[17:55:58] dionysus69: how the hell did my if statement fail :D
[17:56:34] dionysus69: I guess I know the cause too, but the solution seems vague
[17:57:29] dionysus69: Just wanted an experienced advice before I started heavy googling
[17:59:13] samosaphile: dminuoso: well, idk, i don't plan to become a web dev so i am not even looking. i just started doing this on the side as a hobby not for money. It depends on the bootcamp, the good ones, the people coming out do know the difference between array and compiler.
[17:59:26] samosaphile: This isn't me telling me you this. This is what companies like Google/Facebook are saying about them, that the kinds of people some are coming out of some of these high tier bootcamps are virtually indistinguishable from someone who did 4+ years CS degrees at top Uni's. So are you saying The google/facebook engineers who interview and hire these 'trash' JS junior dev, are trolling? Maybe but that is some hardcore level of 12
[17:59:47] samosaphile: Also, I think you forget, these companies (facebook/google/etc) are mostly web companies that work on web stack/technologies. Sure they probably have a few low level C++ embedded firmware engineers somewhere. But they are big companies. Allot of them are to do with stuff like JS/node/react/angular/etc.
[17:59:58] dminuoso: samosaphile: I dont doubt they might hire the random gem that truly stands out.
[18:00:47] dminuoso: But the vast majority of web developers are simpy trash.
[18:01:39] dminuoso: Some bootcamps would have you believe that they can magically wave with a magic wand and turn you into a rich software developer living the silicon valley dream.
[18:02:07] dminuoso: However life operates on the shit-in-shit-out principle.
[18:02:45] samosaphile: i agree, there is not much government regulation or oversite with regards to bootcamps so they are probably biased / skewing their results most definitely
[18:03:07] samosaphile: not exactly sure about the failure rate
[18:03:10] qyliss: has left #RubyOnRails: ("WeeChat 2.1")
[18:03:25] samosaphile: or if that data is even available publicly
[18:03:47] schneider1: has joined #RubyOnRails
[18:04:05] dminuoso: samosaphile: Anyway. At the end of the day not all web developers are bad, but the average income of a webdev in the US is about 60k maybe
[18:04:27] dminuoso: Some companies like airbnb have really good salaries, but they really cherry pick.
[18:05:23] samosaphile: Depends where you live too I think aswell, in you're in silicon valley, they kinda have to pay you more, because even with that 100k+ / yr salary you still can't afford (or barely even rent) a house
[18:05:38] dminuoso: I was talking nationwide average of the US
[18:10:21] samosaphile: But I feel like 'vast majority of web developers being trash', isn't just a web or JS/node thing. That could be said about any language, even C++. I'd go so far to say even ASM too. The only reason you never see a bad asm coder is because there are barely any left in general. The only ones still left working on it are those who are really passionate about it and have been working on it for a long time.
[18:12:35] samosaphile: so if you're main arguement is 'why I am seeing so much trash' => lets blame web JS dev's. It's not so much the language or framework that I'd say does that but ammount of time and experiance dealing with and solving problems
[18:13:09] schneider1: has joined #RubyOnRails
[18:13:59] samosaphile: most js dev's only have a few years or less ...
[18:14:36] samosaphile: I don't believe a JS dev with 25 years of experiance would be that bad
[18:14:37] Cache_Money: I'm having trouble summing and grouping an ActiveRecord query. Is it possible to get one record for each month? Here's how my query is currently constructed: https://gist.github.com/SuperFexy/7ea71b9cead1cbff88c9fd24ea49ce2b
[18:17:40] samosaphile: That being said, I don't know any JS dev with 25 years of experiance that only stuck to 1 language. They probably got bored, eventually learned other languages and paradigms
[18:18:03] orbyt_: has joined #RubyOnRails
[18:18:36] alfiemax: has joined #RubyOnRails
[18:21:53] tycoon177: I am having issues with rubyzip in my rails application. Sometimes, the zip files that are generated cannot be opened on osx, with an error of operation not permitted. I found this relevant issue on github https://github.com/rubyzip/rubyzip/issues/249. I was wondering if anyone else has run into this issue or if there is another library that I can use to zip these files in rails?
[18:22:25] schneider1: has joined #RubyOnRails
[18:31:41] schneider1: has joined #RubyOnRails
[18:32:06] KeyJoo: has joined #RubyOnRails
[18:41:01] schneider1: has joined #RubyOnRails
[18:42:36] weaksauce: has joined #RubyOnRails
[18:43:51] alfiemax: has joined #RubyOnRails
[18:50:25] schneider1: has joined #RubyOnRails
[18:50:41] dionysus69: has joined #RubyOnRails
[18:52:48] orbyt_: has joined #RubyOnRails
[18:58:37] lunarkitty7: has joined #RubyOnRails
[18:58:51] s2013: has joined #RubyOnRails
[18:59:44] schneider1: has joined #RubyOnRails
[19:00:11] alfiemax: has joined #RubyOnRails
[19:02:37] tycoon177: /join #ruby
[19:08:51] nzst: has joined #RubyOnRails
[19:08:59] schneider1: has joined #RubyOnRails
[19:18:19] schneider1: has joined #RubyOnRails
[19:20:55] tipyn: has joined #RubyOnRails
[19:22:56] jottr: has joined #RubyOnRails
[19:27:43] schneider1: has joined #RubyOnRails
[19:28:12] mondongo: has joined #RubyOnRails
[19:30:21] c0lored: has joined #RubyOnRails
[19:32:19] agent_white: has joined #RubyOnRails
[19:32:49] c0lored: i have a rails app that is ANCIENT, I was tasked with getting it to run on the latest stack(ruby 2.4.1 / rails 5.2.0)
[19:32:53] c0lored: I don't know ruby or RoR
[19:33:07] c0lored: but I have managed to squash most bugs that have come up, but I am stuck.
[19:34:35] c0lored: here is my error
[19:34:36] c0lored: https://gist.github.com/c0lored/9f223b647f79189a155ec5e176f6b5e2
[19:34:47] c0lored: could some one kindly point me in the right directrion?
[19:37:16] nzst: what version of ruby and rails was it running on before? and what has been your process to getting it to run on that current version
[19:37:23] roamingdog: c0lored: if you're going straight from ancient to latest, you're going to have a bad time
[19:38:14] c0lored: nzst, it was on ruby enterprise edition 1.8.7-2010.02 / not sure about the rails version.
[19:38:14] dionysus69: has joined #RubyOnRails
[19:38:38] c0lored: roamingdog, thats what I tried to say, said we should probably get a ruby developer but that was shot down
[19:39:48] roamingdog: c0lored: usually, you'd want to go step-by-step, through several rails versions, fixing bugs at each step - not a task for a non-rails person
[19:40:33] nzst: is the app very complicated? what does it do?
[19:40:35] c0lored: yea, throw into the mix 3 purpose made gems, the company that originally wrote this is no longer around
[19:40:59] c0lored: http://youthleadership.net/
[19:41:13] c0lored: its like a mock congress i guess?
[19:41:42] c0lored: that is obvi the production box i have that box cloned and am using the clone for development
[19:43:06] orbyt_: has joined #RubyOnRails
[19:43:25] gambl0re: has joined #RubyOnRails
[19:43:57] roamingdog: c0lored: site doesn't appear to be very complex - if it were me, i'd start with a fresh rails 5 app, and refer to the old app while building it out
[19:44:21] c0lored: once you get logged in it is.
[19:44:34] c0lored: dealing with teachers and students from around the country.
[19:44:54] c0lored: i mean i think i am going to keep pushing to hire a developer.
[19:45:04] c0lored: i feel like its out of my depth.
[19:45:42] nzst: unfortunately, I have to agree. That's not an easy process for even an experienced rails dev
[19:47:47] c0lored: the reason we want to update is i guess the version of activerecord its using is known to be a resource hog and is causing some slow downs, so the update is really to just get to the newest version of activerecord.
[19:49:13] piixal: has joined #RubyOnRails
[19:49:13] nzst: Well, you can work with that and some profiling tools: https://github.com/flyerhzm/bullet , https://github.com/MiniProfiler/rack-mini-profiler and https://github.com/ruby-prof/ruby-prof . Maybe make some performance gains
[19:49:28] nzst: updating your ruby version will help. as will throwing more resources (ram and cpu) at your production box
[19:49:53] c0lored: would i be able to just update ruby and keep the old gems?
[19:50:21] nzst: sometimes, yes
[19:50:32] nzst: depends on the gem dependencies
[19:51:01] c0lored: would the output of my Gemfile help you determine that?
[19:51:17] nzst: i might be able to give you some more direction with that
[19:51:25] c0lored: cool, mind if i dm you?
[19:51:29] nzst: go for it
[19:54:03] tfitts: has joined #RubyOnRails
[19:56:45] dionysus69: has joined #RubyOnRails
[20:04:46] tipyn: has joined #RubyOnRails
[20:10:25] tycoon177: fwiw, i would also suggest rebuilding on a new rails version. we have a rails 3 application at work that we've been trying to get up to rails 5 for some time now..it's hard to both add features and work on upgrading the underlying rails version at the same time
[20:19:21] tejasmanohar: has joined #RubyOnRails
[20:25:53] orbyt_: has joined #RubyOnRails
[20:31:19] roamingdog: has joined #RubyOnRails
[20:31:49] Cache_Money: Is it possible for me to construct my query in a way that will return me just one record for each month? Right now I'm getting two because I'm isolating two specific players: https://gist.github.com/SuperFexy/7ea71b9cead1cbff88c9fd24ea49ce2b
[20:35:46] nzst: you can do a map/reduce type of setup, here's an example https://medium.freecodecamp.org/ruby-using-the-select-map-and-reduce-methods-together-a9b2af30804b
[20:37:22] nzst: i feel like there might be a better way by tweaking your setup a bit, but i'd have to pore over it some more
[20:40:09] kurko_: has joined #RubyOnRails
[20:40:42] nzst: oh yea, you already have the months grouped in arrays, should be easy enough using map and reduce
[20:42:02] tipyn: has joined #RubyOnRails
[20:42:26] drale2k_: has joined #RubyOnRails
[20:42:43] nzst: sum might work, i've never used it. but possibly you can tack it onto your query http://api.rubyonrails.org/classes/ActiveRecord/Calculations.html#method-i-sum
[20:43:42] d3ramius: has joined #RubyOnRails
[20:45:37] DTZUZO_: has joined #RubyOnRails
[20:45:57] Kilobyte22: has joined #RubyOnRails
[20:45:57] arcturiaen_: has joined #RubyOnRails
[20:46:00] Nucky: has joined #RubyOnRails
[20:46:02] mr-robert_: has joined #RubyOnRails
[20:46:07] tfittsy: has joined #RubyOnRails
[20:48:24] sunya7a__: has joined #RubyOnRails
[20:48:28] blitz_: has joined #RubyOnRails
[20:49:13] AntiSpamMeta_: has joined #RubyOnRails
[20:52:10] hfp__work: has joined #RubyOnRails
[20:53:04] s2013: has joined #RubyOnRails
[20:54:02] tpendragon: has joined #RubyOnRails
[20:55:10] Liothen: has joined #RubyOnRails
[20:56:38] tipyn: has joined #RubyOnRails
[20:56:46] dionysus69: has joined #RubyOnRails
[20:58:21] webdestroya: has joined #RubyOnRails
[20:58:37] chridal: has joined #RubyOnRails
[20:59:35] Scient: has joined #RubyOnRails
[21:05:03] cschneid_: has joined #RubyOnRails
[21:20:51] agent_white: has joined #RubyOnRails
[21:23:57] ur5us: has joined #RubyOnRails
[21:38:33] orbyt_: has joined #RubyOnRails
[21:41:53] Yzguy: has joined #RubyOnRails
[21:42:16] elcms: has joined #RubyOnRails
[22:04:15] Bonjourm8: has joined #RubyOnRails
[22:05:34] Yzguy: has joined #RubyOnRails
[22:23:02] apeiros: has joined #RubyOnRails
[22:42:40] za1b1tsu: has joined #RubyOnRails
[22:45:09] conceivably: has joined #RubyOnRails
[22:50:02] prahal: has joined #RubyOnRails
[22:50:21] Bonjourm8: has joined #RubyOnRails
[22:52:45] tipyn: has joined #RubyOnRails
[22:55:39] jnollette: has joined #RubyOnRails
[23:00:57] elcms: has joined #RubyOnRails
[23:03:20] conceivably: Hi. I have a module 'Foo' and a bunch of classes that are nested in it, e.g. 'Foo::Bar'. Now I would like to add another module method on 'Foo' itself, 'baz'. So I have a file in services 'foo.rb' that contains the method nested in the module, defined with 'def self.baz'. From what I understand, I should be able to call 'Foo.baz', but I always get 'undefined method'. Any leads? I've read
[23:03:20] conceivably: https://stackoverflow.com/questions/322470/can-i-invoke-an-instance-method-on-a-ruby-module-without-including-it which seems to suggest that precisely that should be possible :/
[23:04:15] apeiros: has joined #RubyOnRails
[23:05:38] Inside: You need to call module_method :baz?
[23:05:50] Inside: module_function
[23:05:56] Inside: https://apidock.com/ruby/Module/module_function
[23:06:03] conceivably: I have tried that as well, without success.
[23:06:26] Inside: it should just be def baz
[23:06:30] Inside: not self.baz
[23:07:14] conceivably: Tried that too. But also since I do want to call the method on the module without including the module, shouldn't it be self.baz?
[23:07:51] conceivably: I wonder if the file is somehow not being loaded, but it was my understanding that anything in services is autoloaded.
[23:08:07] Inside: That doesn't sound right
[23:09:18] Inside: http://guides.rubyonrails.org/autoloading_and_reloading_constants.html#autoload-paths-and-eager-load-paths
[23:09:50] Inside: $ bin/rails r 'puts ActiveSupport::Dependencies.autoload_paths'
[23:10:33] s2013: has joined #RubyOnRails
[23:10:34] Inside: (I don't know where your services directory is - is it in /app/)?)
[23:10:41] conceivably: Just tried it and it does includ my-app/app/services
[23:11:00] Inside: Is this a brand new project?
[23:11:06] Inside: Are you running in dev mode?
[23:11:39] conceivably: Not new, but running in dev mode. I've also tried 'spring stop' (since that sometimes seems to cause problems).
[23:12:08] d3ramius: has joined #RubyOnRails
[23:12:15] kevinburke: has joined #RubyOnRails
[23:12:18] tipyn: has joined #RubyOnRails
[23:12:19] kevinburke: I'm working on an app that has a lot of fixtures defined.
[23:12:29] Inside: I'm running spring inside virtualbox w/ centos and editing files in a host/guest shared folder from windows
[23:12:40] kevinburke: Is there a way to conditionally load them? E.g. to say in a test file "load these fixtures" but default to not loading them.
[23:12:50] prahal_: has joined #RubyOnRails
[23:12:59] Inside: so I have to use the uhh noneventedwatcher
[23:13:20] Inside: conceivably: have you tried turning your app on and off again after making changes?
[23:13:36] conceivably: Yep, I've restarted. Oh interesting, I just required it manually and it worked. Alright, some kind of loading problem then. Thank you for your suggestions and help Inside.
[23:13:39] Inside: Try config.file_watcher = ActiveSupport::FileUpdateChecker
[23:13:52] Inside: Instead of EventedFileUpdateChecker
[23:14:15] Inside: The listen gem doesn't seem to work well for me.
[23:15:24] kevinburke: hmmm maybe I could move them to a different directory and load with e.g. ActiveRecord::FixtureSet.create_fixtures
[23:15:28] conceivably: Oh I found the error. I had 'foo.rb' in 'services/foo/foo.rb' (since that is where the nested classes reside), but it appears it should simply be 'services/foo.rb'. Thanks again Inside :)
[23:15:36] Inside: you're welcome.
[23:15:49] Inside: Those are the worst problems D:
[23:16:14] Inside: kevinburke: Just how many fixtures and how bad is the loading time?
[23:16:28] kevinburke: about two seconds every time I run tests
[23:16:38] Inside: That's really not bad
[23:16:45] kevinburke: counterpoint: it's bad
[23:16:54] Inside: how long does the whole test suite take?
[23:17:14] kevinburke: not so much about how long the whole test suite takes, as the amount of time it takes to get a single byte of feedback
[23:17:29] kevinburke: right now at about 10-12 seconds, of which 2 are loading fixtures
[23:18:45] Yzguy: has joined #RubyOnRails
[23:19:15] Inside: The advice you're going to get is probably going to be something like 'use factorygirlbot'
[23:20:45] za1b1tsu: has joined #RubyOnRails
[23:26:06] roamingdog: has joined #RubyOnRails
[23:37:03] Inside: Ughh this is so ugly. I have a model where I store sections of a document (in markdown format) as a json array inside of a serialize text-type attribute on the model. Then I'm using react to display the editor for the document, but I'm rendering the markdown to html on the server side and setting it with dangerouslySetInnerHtml D:
[23:40:37] Inside: It can be future inside's problem to fix this :|
[23:43:59] ellcs: has joined #RubyOnRails