#RubyOnRails - 16 July 2018
« Back 1 day Forward 1 day »
[07:10:14] dionysus69: if I put 127.0.0.1:6379 directly into resque.rb, everything's fine but as soon as I move it to env var I get this error URI::InvalidURIError: bad URI(is not URI?): 127.0.0.1:6379, same goes if I change it to localhost
[07:33:34] Radar: I don't get how URI.parse("127.0.0.1") is valid, but URI.parse("127.0.0.1:6379") isn't.
[07:34:43] dionysus69: -- /somePathToApp/shared/bundle/ruby/2.4.0/gems/redis-4.0.1/lib/redis/client.rb:415:in `_parse_options': invalid uri scheme 'localhost' (ArgumentError)
[07:38:25] Radar: Basing my theory off: https://github.com/redis/redis-rb/blob/master/lib/redis/client.rb?utf8=%E2%9C%93#L414-L418
[07:39:10] Radar: I've got about 5 mins left on this train journey and then that'll be me for the night.
[07:39:18] dionysus69: meanwhile adding URI.encode produced same error invalid uri scheme 'localhost' (ArgumentError)
[07:39:47] Radar: dionysus69: should be something like config.host = ENV['REDIS_URL'] where REDIS_URL is set to redis://127.0.0.1:6379. No URI.escape, CGI.escape or other wrappings.
[07:41:14] Radar: sevenseacat: from your gist it looks like it's taking the 127.0.0.1 part as a part of the path.
[07:45:26] Radar: My bet is that that version of resque is not compatible with that version of the redis gem
[07:50:08] dionysus69: just checked and redis and resque versions are the same on both staging and dev
[07:54:49] bijan_: Can someone tell my why rails internal validates method has this signature: def validates(*attributes) and they do special options extraction (for the options hash) instead of let's say def validates(*attributes, **options)?
[07:54:53] bijan_: Source is: https://github.com/rails/rails/blob/375a4143cf5caeb6159b338be824903edfd62836/activemodel/lib/active_model/validations/validates.rb#L104
[07:54:56] sevenseacat: I'd love to know where your rails console thinks that method is defined then
[08:11:28] yuung: a while ago i found this really cool site that had Ruby's source code with annotations on the side describing the code, does anyone know/remember this site?
[08:24:04] syndikate: Is there any helper In rails where I can show the time difference in XX year YY months only? I was looking at disance_of_time_in_words but wasn't sure if that was possible in that method
[08:40:58] dionysus69: sevenseacat, Radar: still same problem after upgrading ruby to 2.4.3 invalid uri scheme 'localhost' and the other error for 127.0.0.1
[08:47:29] syndikate: Trying to use scope: for distance_of_time_in_words, looks much cumbersome to get it working the way I want
[09:07:37] dionysus69: using lower version of redis is not an option for me, redis cache store requires >=4.0.1
[12:12:23] mikecmpbll: i've just upgraded to rails 5, put 'listen' in my Gemfile for ActiveSupport::EventedFileUpdateChecker
[12:12:40] mikecmpbll: and i'm getting a fuck-load of "ERROR: directory is already being watched!" when i run a console or server
[12:13:54] mikecmpbll: to completely unrelated locations, e.g.: ** ERROR: directory is already being watched! ** \ Directory: /private/etc \ is already being watched through: /private/etc
[12:34:22] dionysus69: it runs resque workers, how do I then restart resque workers, and do I have to restart them on every deploy?
[12:34:51] dionysus69: do I just make capistrano restart god systemd process or is there non-root user ways to do it ?
[13:33:51] thomasfedb: My Rails 5.1 app is returning HSTS headers even though config.force_ssl is not set.
[17:34:36] HeyoRockbreaker: I've been trying to setup S3 and Cloudfront to serve images to my site. I've got the bucket and distros up and want to stay on the free plan
[17:34:55] HeyoRockbreaker: Currently I'm trying to set it up to work with my development copy of the site
[17:36:08] HeyoRockbreaker: I keep getting 503 denial requests on just one of my images, which confuses me. I've tried to set CORS settings, signed cookies, and I'm still running into problems. Most guides online don't detail actaully doing anything other than creating the buckets and distributions
[17:36:47] fryguy: well what is making the 503 denial request, where is it coming from, where is it going to, and what is the rails logging showing you?
[17:37:44] HeyoRockbreaker: The rails log is howing a successfully rendered view, let me get the other details and put them in a gist
[17:40:20] HeyoRockbreaker: It actually renders one of the images that is supposed to be delivered with CLoudfront
[17:43:44] HeyoRockbreaker: This is the error thrown in the web console on Chrome https://paste.ubuntu.com/p/pknQtZxkPN/
[17:45:05] fryguy: or your webserver requires vhosting and isn't compatible with the way you set up cloudfront
[17:45:53] HeyoRockbreaker: Mmmm, would it even be possible to set that up with a locally hosted development serveR?
[17:46:58] fryguy: you can, few options: 1. if you are using ipv6, just use that, 2. get a public IPv4 address sending traffic to your machine, 3. using something like ngrok to reverse tunnel
[17:48:15] HeyoRockbreaker: Do you have an alternative suggestion to image upload for a relative beginner other than AWS?
[17:49:39] HeyoRockbreaker: fryguy: I want to serve the images into rendered markdown contained in blog posts
[17:50:45] HeyoRockbreaker: I've heard that it's a bad practice to directly upload images into your own asset file
[17:51:05] HeyoRockbreaker: I suppose that may be bad advice for someone who isn't looking to do anything all that advanced
[17:53:12] HeyoRockbreaker: I also want to serve some of the assets that just makeup the base of site using AWS too
[17:54:40] HeyoRockbreaker: I'm trying to serve all of my image assets using AWS. This includes stuff like the site header image.
[17:55:05] HeyoRockbreaker: I also want to have users be able to upload images to be served in posts the create
[19:36:34] Inside: so like - you can have a 'purchase request' work flow where you define a PR header+detail format, then as you fill it out and submit it, it gets routed to the right people
[19:37:14] Inside: typical BPM software has a graphic editor where you draw lines between boxes to define the flow
[21:44:43] s2013: anyone knows how to connect to heroku prod db locally? i used heroku pg:credentials and got the credentails but cant seem to log in..