« Back to channel list

#RubyOnRails - 30 May 2017

« Back 1 day Forward 1 day »
[00:00:06] chare: wait what the hell rails doesn't have something built in?
[00:05:25] Radar: No, Rails does not have anything built in for this.
[00:05:33] Radar: It's all to do with the deployment of your application.
[00:10:07] nahtnam: has joined #RubyOnRails
[00:13:32] brent__: has joined #RubyOnRails
[00:41:06] ResidentBiscuit: has joined #RubyOnRails
[01:00:02] apparition: has joined #RubyOnRails
[01:02:11] Jameser: has joined #RubyOnRails
[01:08:42] knamehost: has joined #RubyOnRails
[01:09:38] chare: Radar does that mean you can't update a rails app in place you need to rollover to another machine running the updated app?
[01:11:35] ashleydavies: has joined #RubyOnRails
[01:12:19] sevenseacat: has joined #RubyOnRails
[01:12:55] ashleydavies: Hi guys. Hope it's OK to ask a quick question here. I've tried googling but it's tricky to narrow down an exact answer. I'm developing an application (open source) with a few friends for university, and we have a secret key on the server we are hosting in the environment variables
[01:13:25] ashleydavies: Is it bad practice to just have the development and testing keys which existed in the generated project public on version control?
[01:13:57] ashleydavies: Consensus seems to be to avoid it, but I am not sure why - I assumed only the production one matters, and the other two are not important (unless you run your application publically in dev mode?)
[01:23:39] HoierM: has joined #RubyOnRails
[01:27:37] fryguy: ashleydavies: a significant portion of that decision depends on the usefulness of the secret key in other contexts
[01:28:16] ashleydavies: fryguy: We have no intention of using them for anything else, and no plans on public dev/testing builds (other than running a test build on Travis)
[01:31:43] knamehost: has left #RubyOnRails: ("Leaving")
[01:44:48] Uranio: has joined #RubyOnRails
[01:46:32] Radar: chare: Yes that's right.
[01:47:35] Jameser: has joined #RubyOnRails
[01:51:14] ResidentBiscuit: has joined #RubyOnRails
[01:54:36] arBmind: has joined #RubyOnRails
[01:54:54] Uranio: has left #RubyOnRails: ("while you read this, a kitty dies")
[02:03:43] chare: Radar oh shit I just realized that I want zero downtime but I have an extra constraint
[02:03:47] chare: I need websockets
[02:03:58] chare: so I gotta use the new actioncable
[02:04:09] chare: so how the hell do you do zero downtime with actioncable?
[02:06:32] xx00__: has joined #RubyOnRails
[02:10:16] kies: has joined #RubyOnRails
[02:11:26] chare: shit no response means everyone is clueless about this
[02:11:57] Radar: ACTION sighs
[02:12:21] ur5us: has joined #RubyOnRails
[02:12:31] Radar: Wouldn't the websocket connection simply reconnect automatically after a disconnect?
[02:12:35] Radar: Surely that would be trivial to implement.
[02:13:31] sevenseacat: 'no-one answered me in 5 minutes, you're all stupid'?
[02:15:04] Radar: sevenseacat: Remember chare?
[02:15:17] quazimodo: has joined #RubyOnRails
[02:15:20] sevenseacat: I believe so.
[02:15:20] Radar: http://logs.ryanbigg.com/RubyOnRails?date=2014-02-08#1717695
[02:15:54] vrlogrs: has left #RubyOnRails: ()
[02:17:31] chare: wtf you guys keep a recorded log
[02:17:41] sevenseacat: it's in the channel topic.
[02:33:10] roamingdog: has joined #RubyOnRails
[02:33:45] jgpawletko: has joined #RubyOnRails
[02:39:57] roamingdog: has joined #RubyOnRails
[02:40:25] chare: what is the difference between rails s and puma config.ru?
[02:40:28] chare: is there any difference?
[02:41:27] Radar: Both would start the application under puma if puma is in the Gemfile
[02:59:12] desnudopenguino: man I wish I had the POODR book when I was in school. OOD/OOP has never seemed so easy
[02:59:37] sevenseacat: its a great book.
[03:06:17] desnudopenguino: i'm in chapter 2 so far, and it's taking me a step or 2 further than I thought before. and it makes me shudder when I think about my current workload (cleaning up multi-hundred line methods in loosely organized classes)
[03:06:47] desnudopenguino: that's in PHP land though so you guys won't get to hear about those horror stories
[03:10:53] desnudopenguino: are there any other openbsd users in here?
[03:14:20] Radar: I use mac does that count? ;)
[03:18:12] desnudopenguino: no, that's closer to FreeBSD lol, and still a bit of a cousin there. I'm wondering because OpenBSD ships with their own web server and a relay/reverse proxy daemon. i was wondering if anyone was pushing rails apps through those and what their config was
[03:21:24] desnudopenguino: i'm running my stuff with puma through the relay daemon currently (kind of like an nginx server).
[03:23:42] Saukk: has joined #RubyOnRails
[03:26:22] sevenseacat: are we talking in dev or prod?
[03:26:48] sevenseacat: in dev, just use the `rails server`
[03:27:25] sevenseacat: lulz, pragprog wants people to buy AWDWR 5.1 after they already bought AWDWR for 5.0. lolno.
[03:27:49] sevenseacat: be like the elixir people and do free updates for minor revisions
[03:28:42] sevenseacat: agile web development with rails
[03:39:53] kies: has joined #RubyOnRails
[03:41:09] harfangk: has joined #RubyOnRails
[03:56:03] Technodrome: has joined #RubyOnRails
[03:57:33] creature: 5.0 → 5.1 is quite a big update, to be fair.
[03:57:40] Radar: sevenseacat: or be like Manning and don't update for Rails 5 at all :trollface:
[03:57:51] Radar: p.s. when is your Elixir book coming out?
[03:58:07] sevenseacat: when I write it
[04:00:43] cgfbee: has joined #RubyOnRails
[04:04:13] Radar: I sketched out this morning what I need to do for the remainder of DDR. Turns out: it's a lot.
[04:04:35] sevenseacat: are they changing rails faster than you can write
[04:04:36] Radar: Like, all the initializers + what they do need to be covered before I even finish the first half of the book.
[04:04:53] Radar: I'm locking it to just 5.0.2 and I don't plan on doing any updates to the book.
[04:05:11] Radar: I would like my next book to be one on Elixir
[04:05:55] sevenseacat: i'd like that too :D
[04:09:56] rakm: has joined #RubyOnRails
[04:16:41] Jameser: has joined #RubyOnRails
[04:28:29] Jameser: has joined #RubyOnRails
[04:42:09] Jameser: has joined #RubyOnRails
[04:51:56] liquid-silence: @Radar, phoenix?
[04:57:59] zacts: has joined #RubyOnRails
[05:00:23] Radar: liquid-silence: just Elixir I think
[05:02:31] sevenseacat: phoenix isnt as big a leap from elixir as rails is from ruby
[05:02:54] Radar: Phoenix apps are just Elixir apps with a web frontend :D
[05:03:48] Radar: I think there's a market for a "Learn to Program" but with an Elixir tilt.
[05:18:29] cam27: has joined #RubyOnRails
[05:26:37] sevenseacat: hmm what changed between rails 4 and 5 with autoloading?
[05:27:15] sevenseacat: file in lib isnt being autoloaded in production, even though lib is added to autoload paths as usual
[05:28:11] sevenseacat: not being used in production
[05:29:07] sevenseacat: *reading through https://github.com/rails/rails/issues/13142
[05:31:16] kies: has joined #RubyOnRails
[05:32:44] sevenseacat: https://github.com/rails/rails/issues/13142#issuecomment-275549669 *many many thinking faces
[05:36:25] chare: has joined #RubyOnRails
[05:37:38] chare: so I don't understand how pums is suppose to work
[05:37:42] chare: I do "rails s"
[05:37:50] chare: then kill -s SIGUSR2 16056
[05:37:58] chare: like that is suppose to restart puma
[05:38:31] chare: but I get "A server is already running"
[05:38:38] chare: uhhh what???
[05:39:40] chare: sevenseacat you an expert on puma?
[05:39:47] sevenseacat: where does it say killing random processes is how to restart puma?
[05:39:56] Radar: ACTION runs
[05:40:09] chare: puma documentaion clearly says that SIGUSR2 is for restart
[05:40:48] sevenseacat: if thats so, is that for the version of puma you're using?
[05:40:51] Radar: chare: Gist what you're seeing please. I am confused.
[05:40:52] chare: https://github.com/puma/puma
[05:40:56] Radar: chare: Include the command + the output.
[05:42:27] chare: https://gist.github.com/cc-placed/5602ae858e88a49b9ce3f0517fe226d0
[05:42:51] chare: kill -s SIGUSR2 16587
[05:44:28] sevenseacat: hmm, does Rails support the hot reloading?
[05:44:36] Radar: Hm, not sure. It's like it doesn't clear away the server.pid. That server.pid is a Rails feature.
[05:44:37] sevenseacat: thats a rails error, not a puma one
[05:44:44] Radar: Is this local or on production?
[05:45:05] chare: oh shit I'm following mike hartl's book
[05:45:10] chare: its set to puma 3.4
[05:45:15] chare: does that matter that its not latest
[05:46:56] chare: ok upping to version 3.8.2 still has the same problem
[05:47:10] Radar: Ruby must be broken. Time to find another language.
[05:47:22] sevenseacat: no-one ever listens
[05:47:23] Radar: (but no seriously have you considered opening an issue on the puma repo and discuss it there?)
[05:47:28] chare: yes switching to php i'm impatient and expect all frameowkrs and systems to be perfect
[05:47:33] sevenseacat: chare: bye then.
[05:47:33] Radar: ok bye :wave:
[05:47:56] chare: I'm posting to stackoverflow
[05:48:08] chare: and going to set a bounty for 1000 on it
[05:48:21] sevenseacat: but seriously, why do people ask questions but then not listen to any advice theyre given?
[05:48:31] chare: that way some dude who is obsessed with their number on stackoverflow being high will answer ASAP
[05:48:39] Radar: Na I am busy right now
[05:48:46] Radar: maybe later
[05:49:09] sevenseacat: I have enough SO points to ignore ones posted by bratty ppl
[05:49:13] chare: I'm not going to open an issue on puma repo because I"m probably doing something dumb that someone on stackoverflow can answer
[05:49:21] sevenseacat: its still not a puma issue.
[05:49:37] Radar: Probably a rails server thing.
[05:49:43] chare: wait if its not a puma issue then why would i open an issue on puma repo radar?
[05:49:49] Radar: chare: *shrug*
[05:51:32] sevenseacat: I'll go for 'annoy anyone else, just not us'.
[05:52:15] chare: https://github.com/puma/puma/issues/1060
[05:52:28] chare: that must be it
[05:55:15] chare: wtf how did puma become rails default when i doesn't even work?
[05:56:14] rgr: has joined #RubyOnRails
[05:56:19] sevenseacat: 'it has a bug' now means 'it doesnt even work'?
[05:56:30] sevenseacat: in that case, please don't use rails, because it has lots of bugs.
[05:57:28] chare: so here is a question then
[05:57:45] chare: wtf does heroku do since clearly it can handle restarting your app after deploy fine
[05:58:08] kies: has joined #RubyOnRails
[05:58:21] sevenseacat: the heroku docs can probably answer that one.
[05:59:43] chare: damn it life
[05:59:48] chare: by this bug
[06:03:55] sevenseacat: TIL - use config.eager_load_paths in rails 5, not config.autoload_paths
[06:09:06] zacts: has joined #RubyOnRails
[06:13:50] irishfromua: has joined #RubyOnRails
[06:26:07] DoubleMalt: has joined #RubyOnRails
[06:28:39] ahrs: has joined #RubyOnRails
[06:29:30] pwnd_nsfw: I'm assuming zeus doesn't work with rails 5
[06:29:44] pwnd_nsfw: Gem installs, but syntax errors appear when I attempt to run it
[06:30:11] pwnd_nsfw: /home/rob/.rvm/gems/ruby-2.4.1/gems/zeus-0.15.13/build/zeus-linux-386: 1: /home/rob/.rvm/gems/ruby-2.4.1/gems/zeus-0.15.13/build/zeus-linux-386: Syntax error: "(" unexpected
[06:30:25] sevenseacat: never actually used zeus
[06:30:33] pwnd_nsfw: Me neither, I wanted to try it
[06:30:40] pwnd_nsfw: especially since spork hasn't been touched in years.
[06:31:25] sevenseacat: as much as I hate spring, i begrudgingly use it now because the spinup times of our app are insane
[06:31:44] sevenseacat: like 40-60 second
[06:33:50] mikecmpbll: has joined #RubyOnRails
[06:34:05] sevenseacat: i still run into stupid issues every now and then but i'm very aware i'm using spring now so whenever i see stupid issues i know to restart it straight away
[06:35:09] conta: has joined #RubyOnRails
[06:36:36] pwnd_nsfw: Perhaps I'll just settle as well
[06:51:01] mtkd: has joined #RubyOnRails
[06:56:37] defsdoor: has joined #RubyOnRails
[07:32:30] mikecmpbll: has joined #RubyOnRails
[07:34:26] Saukk: has joined #RubyOnRails
[07:42:01] ur5us: has joined #RubyOnRails
[07:58:02] simmerz: has joined #RubyOnRails
[08:09:10] andywww: has joined #RubyOnRails
[08:14:27] sonOfRa: has joined #RubyOnRails
[08:32:05] dionysus69: has joined #RubyOnRails
[08:43:13] urkle: has joined #RubyOnRails
[08:44:53] Sigyn: has joined #RubyOnRails
[08:47:21] Aeyris: https://github.com/Shopify/bootsnap
[08:47:56] Aeyris: we're looking at this for the app spinup prob
[08:48:26] Aeyris: but our app is either smaller or lighter than that, so not as bad as 40-60s
[08:56:28] gregf_: has joined #RubyOnRails
[08:58:43] workmad3: has joined #RubyOnRails
[09:02:21] lxsameer: has joined #RubyOnRails
[09:04:56] marahin: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")
[09:06:16] tbuehlmann: when having conditional validations using a proc/lambda, do you _have_ to provide a block argument? Model.validates(:foo, if: proc { |model| model.bar == 'baz' } ) works as documented, but Model.validates(:foo, if: proc { bar == 'baz' } ) works as well, so self inside the block is the instance in this case. will not using a parameter bite me in certain cases?
[09:09:20] Pumukel: has joined #RubyOnRails
[09:29:03] helpa: has joined #RubyOnRails
[09:31:37] edgr: has joined #RubyOnRails
[09:33:17] urkle: has joined #RubyOnRails
[09:34:23] srinidhi: has joined #RubyOnRails
[09:34:45] lord4163: has joined #RubyOnRails
[09:37:35] shotbug: has joined #RubyOnRails
[09:39:01] harfangk: has joined #RubyOnRails
[09:41:57] marr: has joined #RubyOnRails
[09:47:14] arBmind: has joined #RubyOnRails
[09:49:05] syndikate: has joined #RubyOnRails
[09:49:08] jhass: has joined #RubyOnRails
[09:49:10] wopi: has joined #RubyOnRails
[09:49:11] ja: has joined #RubyOnRails
[09:49:25] clouder|grr: has joined #RubyOnRails
[09:50:29] alfie: has joined #RubyOnRails
[09:54:20] ferr1: has joined #RubyOnRails
[09:55:38] xhoy: is there a way to do 2 part migrations (i move some belongs_to and has_ones around) and i cannot change the "code" before the migration, but after migrating stuff is obviously broken :) so in need to versions of the models one before and one after migrating?
[09:55:55] xhoy: different branch and them merge them one at a time and deploy them?
[10:07:06] mtkd: has joined #RubyOnRails
[10:13:33] wethu: has joined #RubyOnRails
[10:13:33] my123: has joined #RubyOnRails
[10:13:33] am55: has joined #RubyOnRails
[10:13:33] dmz: has joined #RubyOnRails
[10:13:33] segy: has joined #RubyOnRails
[10:13:33] JDeen: has joined #RubyOnRails
[10:13:33] tweaks: has joined #RubyOnRails
[10:13:33] veloutin: has joined #RubyOnRails
[10:13:34] thejoecarroll_: has joined #RubyOnRails
[10:14:21] shotbug: has joined #RubyOnRails
[10:14:23] segy: has joined #RubyOnRails
[10:18:34] syndikate: has joined #RubyOnRails
[10:18:51] rgr: has joined #RubyOnRails
[10:30:59] dionysus69: hey everyone
[10:32:03] dionysus69: I need some insight on how load balancing works so I can come up with a hypothetical scenario and can you please let me know what kind of setup would I need? I am starting working on a full feldged production project and I need to understand deployment costs, at least aproximate
[10:35:31] dionysus69: so lets say I have 100-200 concurrent user all querying some page which hits database. will one 2 core 2GB ram VPS digital ocean be enough? let's say each request has to return 100 rows from the db
[10:37:44] dionysus69: also let's say VPS is running just a rails app, DB and web server are on seperate machines, does it matter if that VPS is single core or multie core, since I vaguely know ruby can't make much use of concurrency even if implemented?
[10:40:41] adlerdias_: has joined #RubyOnRails
[10:52:27] Papierkorb: dionysus69: Just try it using a load test tool
[10:52:42] Papierkorb: dionysus69: 200 concurrent requests is an easy task for such a tool
[10:53:35] dionysus69: any recommendations? i am not familiar with such testing toolchain either :S
[10:55:00] Papierkorb: `ab` ("ApacheBench" - easy to use) or `wtk` (more complex to use, much faster and way more configurability)
[10:55:05] Papierkorb: For your case, both tools suffice
[10:55:53] dionysus69: ok I ll look for something like that but for nginx
[10:56:04] Papierkorb: it doesn't matter what server you use
[10:56:05] dionysus69: thanks Papierkorb :)
[10:56:10] Papierkorb: it's a HTTP load-test client
[10:56:17] dionysus69: kk I guess :)
[10:56:19] Papierkorb: HTTP is the same no matter what HTTP server you use
[10:57:12] mattwithoos: has joined #RubyOnRails
[10:59:59] ErhardtMundt: has joined #RubyOnRails
[11:03:17] simmerz: has joined #RubyOnRails
[11:10:41] simmerz: has joined #RubyOnRails
[11:11:11] gil_: has joined #RubyOnRails
[11:35:43] HoierM: has joined #RubyOnRails
[11:38:52] someish: has joined #RubyOnRails
[11:48:39] jane_booty_doe: has joined #RubyOnRails
[11:50:02] xx00__: has joined #RubyOnRails
[11:55:18] drale2k_: has joined #RubyOnRails
[11:57:47] arBmind: has joined #RubyOnRails
[12:00:50] jane_booty_doe: has joined #RubyOnRails
[12:03:46] shotbug: has joined #RubyOnRails
[12:04:30] urkle: has joined #RubyOnRails
[12:21:54] pupsicle: has joined #RubyOnRails
[12:23:54] mostlybadfly: has joined #RubyOnRails
[12:25:32] hashrocket: has joined #RubyOnRails
[12:27:51] mahloun: has joined #RubyOnRails
[12:31:10] konsolebox: has joined #RubyOnRails
[12:32:47] rgr: has joined #RubyOnRails
[12:34:41] AntiSpamMeta: has joined #RubyOnRails
[12:45:44] AzaToth: has joined #RubyOnRails
[12:49:41] roamingdog: has joined #RubyOnRails
[12:54:25] bruce_lee: has joined #RubyOnRails
[12:56:03] xhoy: dionysus69: i think anything with 2 cores and 2GB of memory will do
[12:56:34] xhoy: dionysus69: BUT it fully depence on the type of pages and requests
[12:56:44] xhoy: dionysus69: assets used etc etc
[12:57:39] jane_booty_doe: has joined #RubyOnRails
[12:59:20] drale2k_: has joined #RubyOnRails
[13:03:48] kthibodeaux: has joined #RubyOnRails
[13:07:13] apparition: has joined #RubyOnRails
[13:08:12] dionysus69: xhoy: won't be anything too heavy, will involve some user table searching
[13:08:18] dionysus69: other than that nothing fancy with db
[13:13:24] quazimodo: has joined #RubyOnRails
[13:18:56] AntiSpamMeta: has joined #RubyOnRails
[13:19:03] drale2k_: has joined #RubyOnRails
[13:23:59] xhoy: and he has left the building
[13:24:36] ur5us: has joined #RubyOnRails
[13:35:29] Or1on: has joined #RubyOnRails
[13:39:00] simmerz: has joined #RubyOnRails
[13:41:48] ResidentBiscuit: has joined #RubyOnRails
[13:42:13] ResidentBiscuit: has joined #RubyOnRails
[13:45:21] kubunto: has joined #RubyOnRails
[13:45:36] kubunto: is it possible to run rails on a raspberry pi
[13:46:33] HoierM: has joined #RubyOnRails
[13:46:55] deur-: kubunto: short answer: yes!
[13:47:37] kubunto: deur-: ive had issues getting it to stand up in the past tho
[13:47:38] deur-: for the long answer and specifics, you'll need to Google :-)
[13:48:40] deur-: I have an rpi2 (model B?) running 3.2 or 4, can't remember
[13:48:55] deur-: but no idea what steps or caveats I came across, it has been a while
[13:49:30] shotbug: has joined #RubyOnRails
[13:50:07] deur-: if I recall correctly, I think openssl gave me issues at the time
[13:50:14] kubunto: deur-: i have the most recent pi
[13:50:24] kubunto: ive had short comings with ruby itself
[13:51:13] kubunto: been a while so i dont recall specifics
[13:51:48] deur-: kubunto: was that with rvm? or the system ruby?
[13:52:32] kubunto: like i sid i dont recall specifics
[13:52:59] kubunto: i should have tried this a lot earlier today to be honest
[13:53:24] deur-: a quick google turned up https://gist.github.com/blacktm/8302741
[13:53:34] deur-: seems to be working for some, though it's from 2014
[13:53:46] drale2k_: has joined #RubyOnRails
[13:54:10] deur-: some activity from april this year though
[13:56:21] xhoy: why wouldn't it run on a raspberry pi? it runs *nix then it runs ruby and then it runs rails?
[13:56:40] sevenseacat: not enough power
[13:57:10] sevenseacat: possibly packages not compatible with an arm cpu
[13:58:12] kubunto: well script failed deur-
[13:58:44] kubunto: couldnt get the compressed file
[13:58:56] kubunto: ruby tar bz
[13:59:40] kubunto: looked to be a verification fail
[14:00:35] deur-: kubunto|afk: that's during the rbenv install line?
[14:01:19] kubunto|afk: deur-: correct
[14:01:28] deur-: if rbenv installed ok, might be worth running `rbenv versions` and try a different ruby
[14:01:34] beccamorgan: has joined #RubyOnRails
[14:06:31] drale2k_: has joined #RubyOnRails
[14:06:52] dminuoso: I have a protect_from_forgery in my ApplicationController, but want to skip it for an action in a controller in an engine - how would I do that?
[14:07:50] dminuoso: The closest thing I can come up with is using the if/unless with a proc and test for controller_name -> but that seems ugly.
[14:08:09] dminuoso: (I dont want to modify the engine itself)
[14:08:52] matthewd: Why is the engine inheriting from ApplicationController? :/
[14:09:37] dminuoso: matthewd: Imagine Im looking skeptical at my screen, thinking that I should not have assumed that it does.
[14:13:41] drale2k_: has joined #RubyOnRails
[14:18:34] Cork: i'm trying to figure out where rails "finds" the id of the current resource (and nested resource and so on) when you run something like url_for(action: "update")
[14:18:52] Cork: i've gotten to action_dispatch/routing/url_for.rb, but then i get stuck in inheritance and can't figure out where to go from there
[14:19:00] Cork: anyone know where to look?
[14:19:54] Cork: it looks like its looking at request but not sure where or how
[14:23:27] drale2k_: has joined #RubyOnRails
[14:28:15] drale2k_: has joined #RubyOnRails
[14:30:03] GodFather: has joined #RubyOnRails
[14:31:55] mikecmpbll: has joined #RubyOnRails
[14:34:07] patarr: has joined #RubyOnRails
[14:40:51] Aytan72: has joined #RubyOnRails
[14:40:53] hobodave: has joined #RubyOnRails
[14:53:10] mtkd: has joined #RubyOnRails
[14:55:36] drale2k_: has joined #RubyOnRails
[15:00:13] francuz: hello everyone, i'm using docker with docker-compose etc... amd i'm having a little problem : when i do docker-compose down, it shut everything down and all as want it to, but it doesn't delete server.pid in my rails files, so i cannot start it again if i don't delete server.pid manually,
[15:00:23] francuz: this is no problem when in production as i do not use volumes, but in developpment it's annoying,
[15:01:36] francuz: anyone has an idea on how i could make it delete server.pid as it goes down ?
[15:07:43] roychri: has joined #RubyOnRails
[15:15:32] mikecmpbll: has joined #RubyOnRails
[15:25:39] ur5us: has joined #RubyOnRails
[15:31:13] ascarter: has joined #RubyOnRails
[15:31:24] safetypin: has joined #RubyOnRails
[15:33:54] brent__: has joined #RubyOnRails
[15:34:50] chouhoulis: has joined #RubyOnRails
[15:38:45] brent__: has joined #RubyOnRails
[15:41:07] drale2k_: has joined #RubyOnRails
[15:45:32] andywww: has joined #RubyOnRails
[15:46:41] cam27: has joined #RubyOnRails
[15:47:04] andywww: has anyone had any experience with text encoding in carrierwave uploads?
[15:47:33] andywww: it seems to insist on reading in all uploaded data as binary then saving it as ascii
[15:52:26] mwlang: has joined #RubyOnRails
[15:54:07] mwlang: Does the authenticity token of forms that were rendered before a deploy completes become invalid? Or even become invalid after time passes without a deploy?
[15:56:23] mwlang: I’m seeing an uncommon number of “invalid authenticity token” rejects in a 4.1.16 app and it seems to be the authenticity tokens that are invalid are ones more than a few hours old…in my case, I confirmed an error by rendering a page the night before then trying to submit the next morning.
[15:56:58] mwlang: and refreshing the page and resubmitting the form was successfully processed.
[16:01:04] dblessing: has joined #RubyOnRails
[16:01:12] drale2k_: has joined #RubyOnRails
[16:01:32] andywww: has joined #RubyOnRails
[16:02:03] irishfromua: has joined #RubyOnRails
[16:02:20] andywww: has joined #RubyOnRails
[16:03:08] andywww: has joined #RubyOnRails
[16:03:56] andywww: has joined #RubyOnRails
[16:04:43] andywww: has joined #RubyOnRails
[16:08:22] tercenya: has joined #RubyOnRails
[16:10:30] drale2k_: has joined #RubyOnRails
[16:17:18] dminuoso: matthewd: I cannot figure out as to why, but Devise does inherit from ApplicationController.
[16:17:53] dminuoso: Though it does not sound too unreasonable, as your application wide controller hooks should apply to an engine as well.
[16:18:24] Exagone313: has joined #RubyOnRails
[16:18:31] dminuoso: (Though it is overrideable)
[16:20:39] beccamorgan: has joined #RubyOnRails
[16:20:52] drale2k_: has joined #RubyOnRails
[16:20:53] matthewd: Hmm.. I guess your best options would be either the proc thing, or creating a separate base class and having Devise inherit from there
[16:24:23] gusrub: has joined #RubyOnRails
[16:27:15] gusrub: has joined #RubyOnRails
[16:27:30] ltd: has joined #RubyOnRails
[16:29:18] dminuoso: matthewd: I guess the best option is a mixture of both, I don't want to disable CSRF for the entire engine after all.
[16:30:46] rakm: has joined #RubyOnRails
[16:33:07] ascarter: has joined #RubyOnRails
[16:41:07] rakm: has joined #RubyOnRails
[16:43:34] kubunto|afk: has left #RubyOnRails: ()
[16:46:15] kies: has joined #RubyOnRails
[16:48:23] hobodave: has joined #RubyOnRails
[16:56:21] gusrub: has joined #RubyOnRails
[16:57:09] mtkd: has joined #RubyOnRails
[16:57:59] mwlang: weird. If I hit a specific url with the web browser, the Rails 4.1 app finds it just fine, but if I hit same url with curl, I get a ActionController::RoutingError
[16:58:19] mwlang: no apparent differences in the requests other than user agent.
[16:58:40] pwnd_nsfw: get post, etc?
[16:59:24] mwlang: Server: nginx/1.10.1 + Phusion Passenger 5.0.30
[17:04:36] mwlang: https://gist.github.com/mwlang/fd1f78e5f8967d0ef0257969ee640c86 shows both 200 and 404 responses captured from log file.
[17:05:32] mwlang: not sure if this is a clue or not, but 99+% of all the 404’s to valid pages were from bots. google, bing, etc., so curl fits with that pattern.
[17:05:40] barhum2013: has joined #RubyOnRails
[17:06:36] mwlang: and this is the route matcher that *should* be matching when the 404 is returned: get '*permalink' => "pages#show", constraints: lambda { |req| req.format == :html }
[17:09:58] duderonomy: has joined #RubyOnRails
[17:14:57] FooBarWidget: has joined #RubyOnRails
[17:16:12] mwlang: the lambda constraint on the route is the issue — its almost as though that header’s lost when curl or other similar UA’s are used instead of one of the browsers. “curl -X GET -H "Content-type: text/html; charset=utf-8”” fails to pass the lambda constraint.
[17:16:36] apeiros: contet-type is for the response, not the request
[17:16:39] apeiros: you need accept
[17:18:21] apeiros: there is content-type in requests too, but that's when you post/patch data.
[17:18:41] mwlang: what is the default for format when one isn’t passed by the UA?
[17:19:39] apeiros: no idea. I'd assume rails defaults to :html as a format.
[17:19:46] tercenya: has joined #RubyOnRails
[17:20:25] apeiros: btw., not explicitly setting a default is bad if you have respond_to :xls. windows + IE with excel installed have (insane, I know, but remember, it's microsoft) .xls with a higher preference than .html
[17:20:33] apeiros: *a default format
[17:21:44] mikecmpbll: has joined #RubyOnRails
[17:25:44] mwlang: apeiros: now that explains the other 1% of the UA’s I was seeing in the logs with the 404…all of those were IE UA's
[17:26:08] gusrub: has joined #RubyOnRails
[17:26:14] FooBarWidget: has joined #RubyOnRails
[17:26:25] ur5us: has joined #RubyOnRails
[17:26:29] mwlang: soooo…trying to surface just what the default format Rails resolves to on these requests….but adding a rescue_from ActionController::RoutingError, with: :log_routing_error to the ApplicationController is not soon enough in the Rack stack.
[17:32:51] mahloun: has joined #RubyOnRails
[17:46:22] jane_booty_doe: has joined #RubyOnRails
[17:48:38] mwlang: getting somewhere. curl requests format of “*/*” instead of “text/html”
[17:49:18] normie1: has joined #RubyOnRails
[17:50:04] mwlang: I always thought req.format was symbolized by Rails by the time you’re looking at the request accessors, but apparently it’s still a string or at least some special kind of string that can compare against :format, “text/html” as one and the same.
[17:50:53] DLSteve_: has joined #RubyOnRails
[17:52:40] mwlang: and interestingly, IE7, etc. are sending “\ntext/html\n” which isn’t the same as just “text/html”
[17:56:46] hobodave: has joined #RubyOnRails
[17:56:53] beccamorgan: has joined #RubyOnRails
[17:57:19] mwlang: its a Mime::Type, not a string! (learned something new today)
[17:58:58] andrew9184: has joined #RubyOnRails
[17:59:01] lxsameer: has joined #RubyOnRails
[18:03:33] apeiros: */* means everything, but you require html
[18:04:08] apeiros: I don't think IE sends \ntext/html\n?
[18:04:22] apeiros: that sounds more like bad parsing of the request headers…
[18:04:53] andrew9184: has joined #RubyOnRails
[18:05:39] apeiros: mwlang: I think your constraint disrupts content negotiation
[18:09:20] mwlang: apeiros: as it turns out, Rails is parsing the header correctly into a Mime::Type but the string accessor preserves the original header text sent.
[18:09:58] mwlang: and when comparing against a symbol and Mime::Type, it’s being coerced to Symbol for comparison.
[18:10:54] mwlang: so, what I really want is HTML is requested or nothing was specified (i.e. ‘*/*’). That changes the constraint to this: get '*permalink' => "pages#show", constraints: lambda { |req| req.format.html? || req.format == "*/*" }
[18:12:00] mwlang: which fulfills the original intent that XML and JSON, and any other explicitly requested format other than HTML is requested, it’s rejected with 404 response.
[18:12:46] apeiros: what about text/*?
[18:12:57] apeiros: what about */html? (not sure that one is valid, the former certainly is)
[18:13:11] zapho: has joined #RubyOnRails
[18:13:39] apeiros: I'd assume Mime::Type to provide a method to match against another Mime::Type. you should probably use that.
[18:14:52] mwlang: well, I’m matching on what’s being sent. ‘*/*’ is what’s being sent.
[18:15:49] apeiros: I don't think you're doing it correctly. additionally to what I said above: accept can contain a list, not just a single (and that's actually most common). google "content negotiation".
[18:16:00] mwlang: I monkey patched actionpack’s debug_exceptions to log rejected formats in the future, so we’ll see how it all shakes out.
[18:16:36] apeiros: also I'm quite convinced you're reinventing something rails can already do for you.
[18:17:17] mwlang: apeiros: if I’m reinventing it, not sure how….combed through the Mime::Type docs for the solution I came up with.
[18:17:49] mwlang: the one thing Rails is doing with Mime::Type is when there’s several request formats, if at least one is HTML, then #html? returns true.
[18:18:19] mwlang: So, I think by checking that first and falling back to testing ‘*/*’, I get the use cases I need covered.
[18:19:13] matthewd: Rails wouldn't use a 404 for that; if you insist on using the wrong response code you'll have to do at least some fighting somewhere
[18:19:33] xx00__: has joined #RubyOnRails
[18:20:21] matthewd: But otherwise, isn't this what `respond_to {|format| format.html { } }` in PagesController#show would do?
[18:22:45] apeiros: and/or respond_with
[18:23:13] mwlang: matthewd: it may not be Rails per se, but nginx is definitely responding with 404: "GET /home/nautilus HTTP/1.1" 404 1564 "-" "curl/7.51.0"
[18:23:40] mwlang: as for format in the action of the controller, this is matching on the routes and we were seeing a lot of hack attempts with both XML and JSON.
[18:24:01] mwlang: at the end of the day, it may be far better to move this out of the routes constraint and into nginx’s config.
[18:24:16] matthewd: mwlang: It will if you do the thing you're doing, sure. But that's the wrong response code.
[18:24:32] beccamorgan: has joined #RubyOnRails
[18:24:32] mwlang: but even more to the point, getting rid of the wildcard matcher altogether is my ultimate goal.
[18:24:40] Ferdroid: has joined #RubyOnRails
[18:25:51] mwlang: matthewd: I agree, but I’m not setting it. it’s getting set in actionpack: see the callstack of this gist: https://gist.github.com/mwlang/fd1f78e5f8967d0ef0257969ee640c86
[18:26:16] mwlang: I’d rather send 403, bad request.
[18:26:49] mwlang: sorry, 400, bad request, not 403 forbidden. :-/
[18:29:33] beccamorgan: has joined #RubyOnRails
[18:30:22] amritoit: has joined #RubyOnRails
[18:32:20] conta2: has joined #RubyOnRails
[18:32:58] lxsameer: has joined #RubyOnRails
[18:33:31] Exagone313: has joined #RubyOnRails
[18:40:47] beingjohnm: has joined #RubyOnRails
[18:42:09] SteenJobs: has joined #RubyOnRails
[18:45:08] tercenya: has joined #RubyOnRails
[18:47:13] pLaTo0n: has joined #RubyOnRails
[18:50:27] hobodave: has joined #RubyOnRails
[18:52:23] patarr1: has joined #RubyOnRails
[19:05:04] mikecmpb_: has joined #RubyOnRails
[19:11:40] Aherin: has joined #RubyOnRails
[19:14:44] dionysus69: has joined #RubyOnRails
[19:17:18] hobodave: has joined #RubyOnRails
[19:17:54] centrx: has joined #RubyOnRails
[19:24:50] ur5us: has joined #RubyOnRails
[19:27:44] srinidhi: has joined #RubyOnRails
[19:31:15] simmerz: has joined #RubyOnRails
[19:38:30] ur5us: has joined #RubyOnRails
[19:40:23] SteenJobs: has joined #RubyOnRails
[19:42:45] GodFather: has joined #RubyOnRails
[19:43:28] tercenya: has joined #RubyOnRails
[19:51:58] roamingdog: has joined #RubyOnRails
[19:56:52] hahuang65: has joined #RubyOnRails
[19:59:17] patarr: has joined #RubyOnRails
[20:04:46] DLSteve_: has joined #RubyOnRails
[20:04:46] SteenJobs: has joined #RubyOnRails
[20:07:16] ArTiSTiX: has joined #RubyOnRails
[20:12:06] marr: has joined #RubyOnRails
[20:15:39] Pumukel: has joined #RubyOnRails
[20:26:16] brent__: has joined #RubyOnRails
[20:35:13] dionysus70: has joined #RubyOnRails
[20:38:28] ace05: has joined #RubyOnRails
[20:50:32] gil_: has joined #RubyOnRails
[20:57:21] simmerz: has joined #RubyOnRails
[20:58:11] simmerz: has joined #RubyOnRails
[20:59:07] ur5us: has joined #RubyOnRails
[20:59:10] simmerz: has joined #RubyOnRails
[20:59:58] simmerz: has joined #RubyOnRails
[21:00:43] simmerz: has joined #RubyOnRails
[21:05:43] simmerz: has joined #RubyOnRails
[21:07:32] gil_: has joined #RubyOnRails
[21:13:54] workmad3: has joined #RubyOnRails
[21:14:40] troys: has joined #RubyOnRails
[21:18:26] arup_r: has joined #RubyOnRails
[21:20:28] Archrover: has joined #RubyOnRails
[21:23:16] zacts: has joined #RubyOnRails
[21:30:23] andrew9184: has joined #RubyOnRails
[21:47:18] ascarter: has joined #RubyOnRails
[21:50:17] arBmind: has joined #RubyOnRails
[21:59:32] xx00__: has joined #RubyOnRails
[22:02:37] weathermaker: has joined #RubyOnRails
[22:12:24] patarr: has joined #RubyOnRails
[22:19:08] HoierM: has joined #RubyOnRails
[22:21:10] zapho: has joined #RubyOnRails
[22:29:11] duderonomy: has joined #RubyOnRails
[22:30:03] Radar: has joined #RubyOnRails
[22:30:07] Radar: GOOD MORNING
[22:34:25] shtirlic: has joined #RubyOnRails
[22:40:45] weaksauce: has joined #RubyOnRails
[23:11:42] gusrub: has joined #RubyOnRails
[23:28:43] cam27: has joined #RubyOnRails
[23:34:09] zapho: has joined #RubyOnRails
[23:37:14] andrew9184: has joined #RubyOnRails
[23:38:56] cam27: has joined #RubyOnRails
[23:40:01] kies: has joined #RubyOnRails
[23:52:01] zapho: has joined #RubyOnRails
[23:57:57] zapho: has joined #RubyOnRails