« Back to channel list

#RubyOnRails - 22 February 2019

« Back 1 day Forward 1 day »
[00:08:42] srruby: has joined #RubyOnRails
[00:09:08] srruby: delayed_job: Does delayed job start a new rails instance when it runs?
[00:12:16] IGnorAND: does a job require a 'cron thing'?
[00:19:42] barhum2013: has joined #RubyOnRails
[00:27:29] orbyt_: has joined #RubyOnRails
[00:41:35] ariedler: has joined #RubyOnRails
[00:44:57] atrius: has joined #RubyOnRails
[00:49:07] sevenseacat: has joined #RubyOnRails
[00:52:27] ariedler: has joined #RubyOnRails
[00:57:50] Ryanar: has joined #RubyOnRails
[01:08:37] ariedler: has joined #RubyOnRails
[01:10:42] ariedler: has joined #RubyOnRails
[01:19:05] havenwood: IGnorAND: no crontab, if that's what you mean?
[01:19:21] havenwood: IGnorAND: most jobs aren't scheduled, though some Active Job backends support that.
[01:19:26] barhum2013: has joined #RubyOnRails
[01:19:47] havenwood: IGnorAND: Oh, you're replying to srruby - never mind and sorry for the noise!
[01:20:09] havenwood: ACTION manages to read a whole two lines of backlog...
[01:24:16] bruul: has joined #RubyOnRails
[01:26:09] Dreamer3: has joined #RubyOnRails
[01:37:22] Tempesta: has joined #RubyOnRails
[01:52:40] orbyt_: has joined #RubyOnRails
[02:09:54] ariedler: has joined #RubyOnRails
[02:13:08] ariedler_: has joined #RubyOnRails
[02:23:54] bga57: has joined #RubyOnRails
[02:31:14] beingjohnm: has joined #RubyOnRails
[02:42:51] ariedler: has joined #RubyOnRails
[02:44:28] ariedler: has joined #RubyOnRails
[03:05:31] ariedler: has joined #RubyOnRails
[03:06:41] blackbaba: has joined #RubyOnRails
[03:32:10] Saukk: has joined #RubyOnRails
[03:55:54] tdy: has joined #RubyOnRails
[03:56:39] MrCrackPotBuilde: has joined #RubyOnRails
[04:03:05] kvda: has joined #RubyOnRails
[04:09:40] braincrash: has joined #RubyOnRails
[04:17:19] srinidhi: has joined #RubyOnRails
[04:18:37] ur5us: has joined #RubyOnRails
[04:19:35] srinidhi: has joined #RubyOnRails
[04:41:00] bruul: has joined #RubyOnRails
[05:05:12] v01d4lph4: has joined #RubyOnRails
[05:13:25] barhum2013: has joined #RubyOnRails
[05:28:25] barhum2013: has joined #RubyOnRails
[05:29:37] Ryanar: has joined #RubyOnRails
[05:51:09] uks: has joined #RubyOnRails
[06:18:11] conta: has joined #RubyOnRails
[07:18:42] srinidhi: has joined #RubyOnRails
[07:23:03] nones: has joined #RubyOnRails
[07:23:51] _aeris_: has joined #RubyOnRails
[07:26:35] kvda: has joined #RubyOnRails
[08:18:31] conta: has joined #RubyOnRails
[08:28:16] Linuus`: has joined #RubyOnRails
[08:46:21] blackmesa: has joined #RubyOnRails
[09:05:56] lxsameer: has joined #RubyOnRails
[09:06:16] mikecmpbll: has joined #RubyOnRails
[09:09:55] dionysus69: has joined #RubyOnRails
[09:38:11] mikecmpb_: has joined #RubyOnRails
[09:39:15] mikecmpbll: has joined #RubyOnRails
[09:49:55] Technodrome: has joined #RubyOnRails
[10:07:38] tdy1: has joined #RubyOnRails
[10:22:36] dustinm`: has joined #RubyOnRails
[10:27:20] Linuus: has joined #RubyOnRails
[10:27:33] mangold: has joined #RubyOnRails
[10:27:41] blackmesa: has joined #RubyOnRails
[10:28:32] Linuus: has joined #RubyOnRails
[10:42:39] conta: has joined #RubyOnRails
[11:04:00] IGnorAND: @havenwood no problem :)
[11:04:44] IGnorAND: @havenwood, I also , solved my previous question with the help of shared knowledge :) In my controller I have a resource, id = request.path.split('/')[3,4] @addressable = resource.singularize.classify.constantize.find(id)
[11:46:38] adgtl: has joined #RubyOnRails
[11:47:13] lankanmon: has joined #RubyOnRails
[11:48:29] ur5us: has joined #RubyOnRails
[11:55:25] ariedler: has joined #RubyOnRails
[11:56:56] ariedler: has joined #RubyOnRails
[11:59:32] kvda: has joined #RubyOnRails
[12:09:07] Ryanar: has joined #RubyOnRails
[12:11:57] nones: has joined #RubyOnRails
[12:12:23] blackmesa: Hi all. I have a Freebsd server running rails. I wanted to use nodejs
[12:12:29] blackmesa: I set ENV['EXECJS_RUNTIME'] = 'Node' in boot.rb
[12:12:32] blackmesa: still errors
[12:12:55] blackmesa: Error: The application encountered the following error: Node.js (V8) runtime is not available on this system
[12:13:06] blackmesa: Rails 5.2, Nginx, Phusion Passenger
[12:14:38] blackmesa: passenger_nodejs /usr/local/bin/node; doesnt help either
[12:26:49] gheegh: has joined #RubyOnRails
[12:26:59] andywww: has joined #RubyOnRails
[12:37:19] gregf_: has joined #RubyOnRails
[12:37:39] tjbp: has joined #RubyOnRails
[13:03:13] Linuus`: has joined #RubyOnRails
[13:24:17] IGnorAND: @blackmesa if you use nodejs, I dont think you need to specify something in boot.rb
[13:27:07] blackmesa: I tried everything, for months now. Always trying to get it to work. it never does.
[13:27:14] blackmesa: I always fallback to therubyracer gem
[13:32:49] IGnorAND: blackmesa: odd
[13:32:57] IGnorAND: do a forgot fbsd commands
[13:33:03] IGnorAND: ports install npm
[13:33:20] IGnorAND: I believe that was how you install on fbsd
[13:33:25] IGnorAND: haven't touched it in so long
[13:37:32] IGnorAND: blackmesa: did that work?
[13:38:20] IGnorAND: Config it again as if you were to use therubyracer. Then remove therubyracer gem from your gemfile, do a bundle install, do a port install of 'npm'
[13:39:07] ariedler: has joined #RubyOnRails
[13:44:13] srinidhi: has joined #RubyOnRails
[13:56:21] blackmesa: Hey IGnorAND thx for your replies. On Freebsd you install node via ports.
[13:56:29] blackmesa: /usr/local/bin/node is available
[13:56:44] blackmesa: but somehow either Rails or Passenger know about it
[13:57:00] blackmesa: there is a command for passenger: passenger_nodejs
[13:57:14] blackmesa: which I set to /usr/local/bin/node in the nginx.conf
[13:57:20] IGnorAND: blackmesa: can you run npm -v in shell on your bsd box?
[13:57:44] blackmesa: npm is not installed
[13:58:00] blackmesa: I use yarn for packages
[13:58:50] blackmesa: Ive been running my rails app for years now on my freebsd server. Everything works fine. But from time to time I always want to dump the therubyracer gem
[13:59:02] blackmesa: because it should use nodejs for this
[13:59:20] blackmesa: I always end up putting therubyracer back into the Gemfile :D
[14:04:37] NeXTSUN: has joined #RubyOnRails
[14:11:18] ariedler: has joined #RubyOnRails
[14:13:50] IGnorAND: blackmesa: https://gist.github.com/nuheluxulu/48e38f3bdc5abf037f62120cf31142a9 This is in my nginx config file
[14:14:12] IGnorAND: blackmesa: I use yarn as well, but I installed npm on my server
[14:15:59] IGnorAND: I did a npm with the package manager and then a npm install yarn -g
[14:16:08] blackmesa: looks almost exactly like mine. I will take a look into it and install npm. thanks IGnorAND for your time
[14:16:18] blackmesa: I use mina for deployments
[14:16:22] IGnorAND: blackmesa: np, we're here to help each other
[14:16:59] IGnorAND: I used capistrano, been looking into looking what mina is. You're the xth person to tell me about mina
[14:18:46] blackmesa: give it a try. been using it for years. but I havent looked into multi-stage deployments. Not sure if its supported
[14:20:54] IGnorAND: well, I just recently got back into programming
[14:21:00] IGnorAND: thinking its a better way to win my bread
[14:21:08] IGnorAND: not sure if I am jumping in a big black hole
[14:23:00] blackmesa: welcome back and best wishes!
[14:23:25] IGnorAND: Haha, thanks :)
[14:23:31] IGnorAND: I'll be bugging you for help too :P
[14:25:56] blackmesa: hopefully I can help
[14:28:55] IGnorAND: well, I need more help on philosphical level I think
[14:29:39] IGnorAND: Like, I am currently trying to build (yet another) HRM application. I have a model Person.
[14:31:17] IGnorAND: I am a believe that the database should be full of facts and the user interface has information (things derived from facts). So the database has a day_of_birth for a person, never an age (this is obvious). But I see that people often have a field like boolean:is_employee. I'd rather have a table with employments with a start_date and end_date
[14:32:20] IGnorAND: so if end_date is null or end_date in the past, the person is an employee. Instead of reading a boolean field
[14:32:35] blackmesa: I like that more
[14:32:40] blackmesa: with start_date and end_date
[14:32:57] blackmesa: you can add a boolean 'active' or something
[14:33:16] blackmesa: or active if in Range
[14:33:41] IGnorAND: why would you add the boolean active? It would cause inconsistencies. People would 'forget' to alter the boolean
[14:34:25] IGnorAND: If you 'want' a boolean with active I would do a create VIEW in the DB making sure the active boolean gets re-evaluated everytime
[14:34:28] blackmesa: I also have a table with a start_time and end_time
[14:34:42] blackmesa: scope :current_week, -> { where(start_time: Time.current.beginning_of_week..Time.current.end_of_week) }
[14:34:46] blackmesa: and use this scope
[14:35:18] blackmesa: end_time not used here
[14:35:31] IGnorAND: Anyway, I have a list of People now. I'd like to add InCaseofEmergency contact. Not sure if I should add it to the Person or the Employment.
[14:36:43] blackmesa: Id to it to the Person table (People)
[14:37:14] IGnorAND: yeah, I suppose it makes sense as even if the person is no longer employed the ICE shouldn't disappear
[14:37:15] blackmesa: that contact is not only for the employment
[14:44:56] IGnorAND: I wonder if ICE should also be a polymorphic as you would most likely have a ICE for a company as well ^,^
[14:50:32] orbyt_: has joined #RubyOnRails
[15:04:24] Saukk: has joined #RubyOnRails
[15:21:22] skryking: has joined #RubyOnRails
[15:29:49] jobewan: has joined #RubyOnRails
[15:37:51] maryo: has joined #RubyOnRails
[15:38:16] mangold: has joined #RubyOnRails
[15:53:41] skryking: has joined #RubyOnRails
[16:16:55] conta: has joined #RubyOnRails
[16:23:37] SteenJobs: has joined #RubyOnRails
[16:26:06] agent_white: has joined #RubyOnRails
[16:28:03] tdy1: has joined #RubyOnRails
[16:32:04] maryo: has joined #RubyOnRails
[16:37:02] maryo: has joined #RubyOnRails
[16:49:43] [Butch]: has joined #RubyOnRails
[16:55:36] maryo: has joined #RubyOnRails
[17:23:00] adgtl: has joined #RubyOnRails
[17:23:44] Technodrome: has joined #RubyOnRails
[17:27:31] v01d4lph4: has joined #RubyOnRails
[17:27:43] conta: has joined #RubyOnRails
[17:31:48] orbyt_: has joined #RubyOnRails
[17:34:52] pLaTo0n: has joined #RubyOnRails
[17:40:30] reber: has joined #RubyOnRails
[17:55:44] tjbp: has joined #RubyOnRails
[17:55:49] ravenousmoose: has joined #RubyOnRails
[17:59:57] sameerynho: has joined #RubyOnRails
[18:00:17] mikecmpbll: has joined #RubyOnRails
[18:15:07] SteenJobs: has joined #RubyOnRails
[18:19:08] Saukk: has joined #RubyOnRails
[18:25:27] beholders_eye: has joined #RubyOnRails
[18:30:42] conta: has joined #RubyOnRails
[18:33:35] jhava: has joined #RubyOnRails
[18:38:10] jhava: Hello, I am not a ruby programer. I am stuck with a ruby app at one of my servers that I want to change only a text in a page.
[18:39:23] jhava: I found the text in /app/views/dashboards/home.html.erb and changed it in the production server
[18:39:38] jhava: the original git repository is no longer available.
[18:40:32] jhava: How do I recompile the app so that small change is taken in the app and is visible in the web page ?
[18:40:39] jhava: It is just a title change
[18:41:43] snk: if it's running through something like phusion/passenger, i think you'd just need to restart the passenger app server
[18:42:20] jhava: it is running under apache, and there is a helper I believe, let me check
[18:42:22] snk: which may/may not be connected to the web server software
[18:42:43] snk: if it's apache/mod_passenger, kicking apache should do it, i think
[18:43:18] jhava: PassengerRuby /usr/local/rvm/gems/ruby-2.4.0/wrappers/ruby
[18:43:27] jhava: This is on apache directives
[18:44:12] jhava: Restarting apache, running the original two deployment sentences I was tought did not do the trick
[18:44:55] snk: could also try some of the other restart methods at: https://www.phusionpassenger.com/library/admin/apache/restart_app.html#application-restart-methods
[18:45:22] snk: if those don't work, i'd check if you've got some sort of cache in front of the site
[18:45:26] jhava: bundle install --deployment --without development test
[18:45:37] jhava: RAILS_ENV=production bin/rails assets:precompile
[18:46:28] jhava: cache is either in the app code, the apache server it on my own server and this is accesed internally
[18:46:45] jhava: or in the compiled app
[18:48:07] snk: hmm, restarting the app server and/or apache should really take care of it :/
[18:48:32] snk: are you 100% sure that the home.html.erb file is the view corresponding to the page you're trying to change?
[18:48:51] jhava: tried the restart on the application restart method. It did not work. But that gave me a hint
[18:49:24] jhava: There are several copies of the same app, serving different backend database data with the same info
[18:49:36] jhava: chart1, chart2, chart3 and charttest
[18:51:04] jhava: each one has a virtual name server in apache, but when I ask to restart charttest, it is indicating me that it is restarting chart1
[18:51:40] jhava: I am standing on the linux server on charttest directory and there I send the restart command
[18:52:11] orbyt_: has joined #RubyOnRails
[18:52:11] jhava: It is as if the code was copied and is taking the original app as reference
[18:52:35] jhava: where is the app directory or root configured in ruby ?
[18:57:17] jhava: I just changed a text in chart1 and by restarting the app under charttest, the changes came into effect
[18:57:44] jhava: So there is a directory configuration issue that I cannot find.
[18:58:04] ghormoon: has joined #RubyOnRails
[19:03:36] beholders_eye: has joined #RubyOnRails
[19:07:49] blackmesa: has joined #RubyOnRails
[19:32:30] conta2: has joined #RubyOnRails
[19:32:53] WRONgG: has joined #RubyOnRails
[19:33:36] gambl0r3: has joined #RubyOnRails
[19:56:11] SteenJobs: has joined #RubyOnRails
[20:33:47] WRONgG: has joined #RubyOnRails
[20:40:49] tdy1: has joined #RubyOnRails
[21:00:10] tdy: has joined #RubyOnRails
[21:04:48] blackmesa: why doesnt puma recognize a production environment?
[21:07:32] blackmesa: I mean is puma only for development?
[21:10:04] blackmesa: rails_env = "production"
[21:10:06] blackmesa: environment "production"
[21:10:22] blackmesa: not even recognized
[21:16:28] havenwood: blackmesa: How're you running it? What command?
[21:16:33] blindMoe: has joined #RubyOnRails
[21:17:02] havenwood: blackmesa: e.g.: RACK_ENV=production bundle exec puma --environment production
[21:18:37] havenwood: blackmesa: oh, Capistrano?
[21:21:29] blackmesa: havenwood: https://pastebin.com/raw/PgfzFJ9d
[21:21:42] blackmesa: mina for deployments
[21:22:39] blackmesa: https://pastebin.com/raw/SDcvQmFB
[21:31:51] blackmesa: havenwood: bundle exec puma -p 3000 -e production
[21:31:55] blackmesa: seems to work better
[21:32:18] havenwood: blackmesa: puma and pumactl take different args
[21:32:20] havenwood: blackmesa: -C, --control-url URL The bind url to use for the control server
[21:32:39] Fernando-Basso: has joined #RubyOnRails
[21:32:46] havenwood: blackmesa: I think you're looking meant -F but have -C:
[21:32:47] havenwood: -F, --config-file PATH Puma config script
[21:33:17] blackmesa: havenwood: https://pastebin.com/raw/HKmVYztw
[21:34:28] blackmesa: but isnt 3000 supposed to be a development port?
[21:35:41] blindMoe: Is there a standard way of dealing with user submitted string in regex that are not ASCII_8BIT? Seems like sending in a utf-8 string causes it to throw icompatible encoding errors. I can force the encoding and remove invalid characters but that kind of defeats the purpose of the check
[21:42:17] havenwood: blackmesa: You have `-p 3000`, which sets it to port 3000.
[21:42:44] havenwood: blindmoe: Do you mean the other way around? It's really utf-8 that the Regexp is choking on? Have a small reproduction script you can show us?
[21:43:28] blindMoe: I think you are correct.. other way around
[21:43:55] blindMoe: /Blah Müller Blah/i =~ 128.chr
[21:43:59] blindMoe: that will cause the error I am seeing
[21:45:07] blindMoe: that snippet is essentially what the system is trying to run
[21:45:12] hays: has joined #RubyOnRails
[21:45:21] havenwood: blindmoe: 128.chr('utf-8').encoding #=> #<Encoding:UTF-8>
[21:46:19] havenwood: /Blah Müller Blah/ =~ 128.chr('utf-8')
[21:46:39] blindMoe: /Blah Müller Blah/i =~ 128.chr.encode(Encoding::UTF_8)
[21:46:39] blindMoe: Encoding::UndefinedConversionError: "\x80" from ASCII-8BIT to UTF-8
[21:47:18] havenwood: blindmoe: Instead, try just: 128.chr(Encoding::UTF_8)
[21:48:48] blindMoe: havenwood: Sorry the actual code doesn't use 128.chr .. I was just using it as an example to create the type of character that causes the issue
[21:48:56] blindMoe: so it would be more like "\x80"
[21:49:22] havenwood: "\x80".encoding #=> #<Encoding:UTF-8>
[21:49:34] havenwood: "\x80".b.encoding #=> #<Encoding:ASCII-8BIT>
[21:50:48] havenwood: "\x80".b.force_encoding(Encoding::UTF_8).encoding #=> #<Encoding:UTF-8>
[21:50:57] havenwood: blindmoe: Where is the binary data coming from?
[21:52:17] blindMoe: a user enters in a keyword they want to search a string for, so the string in the regex comes from the database, the string on the right hand side comes from user input
[21:52:17] havenwood: blindmoe: can you change the db encoding to utf-8?
[21:52:28] blindMoe: odd thing is... it is utf-8
[21:54:10] blindMoe: I'll see if I can get some more info from the user about what exactly it was they were trying to input
[21:55:07] dviola: has joined #RubyOnRails
[21:58:46] tdy: has joined #RubyOnRails
[22:29:24] my1es: has joined #RubyOnRails
[22:29:49] Technodrome: has joined #RubyOnRails
[23:04:34] hahuang6-: has joined #RubyOnRails
[23:15:45] tdy1: has joined #RubyOnRails
[23:16:29] ariedler: has joined #RubyOnRails
[23:21:02] tdy1: has joined #RubyOnRails
[23:25:21] phait0_: has joined #RubyOnRails
[23:33:01] ariedler: has joined #RubyOnRails
[23:34:34] ariedler: has joined #RubyOnRails
[23:35:21] beholders_eye: has joined #RubyOnRails
[23:36:19] Ryanar: has joined #RubyOnRails
[23:40:29] hahuang65: has joined #RubyOnRails
[23:41:04] phait0_: has left #RubyOnRails: ()
[23:53:45] work_: has joined #RubyOnRails
[23:58:49] ariedler: has joined #RubyOnRails