« Back to channel list

#RubyOnRails - 12 June 2018

« Back 1 day Forward 1 day »
[00:16:33] workmad3: has joined #RubyOnRails
[00:25:19] dviola: has joined #RubyOnRails
[00:29:22] za1b1tsu: has joined #RubyOnRails
[00:58:47] agent_white: has joined #RubyOnRails
[01:20:03] chouhoulis: has joined #RubyOnRails
[01:31:07] za1b1tsu: has joined #RubyOnRails
[01:31:36] sevenseacat: has joined #RubyOnRails
[01:52:32] darkhanb: has joined #RubyOnRails
[01:54:24] andrewray: has joined #RubyOnRails
[02:03:42] bga57: has joined #RubyOnRails
[02:04:05] za1b1tsu: has joined #RubyOnRails
[02:05:03] ur5us: has joined #RubyOnRails
[02:13:00] regedit: has joined #RubyOnRails
[02:17:21] workmad3: has joined #RubyOnRails
[02:50:24] chouhoulis: has joined #RubyOnRails
[03:03:02] CuriousMind: has joined #RubyOnRails
[03:04:03] CuriousMind: has joined #RubyOnRails
[03:07:16] CuriousMind: Hi, I deployed my app to heroku, but it won't work. Can someone help me solve this problem?
[03:08:09] helpa: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[03:08:42] CuriousMind: sevenseacat: I see ok
[03:10:10] braincrash: has joined #RubyOnRails
[03:12:08] CuriousMind: sevenseacat: Here is my heroku logs output - https://gist.github.com/Osagiede/0a6f52ad875108ce33025725cb4c3543. The error says Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? sqlite3 is not part of the bundle. Add it to your Gemfile. (Gem::LoadError) but it is in my Gemfile.
[03:12:21] sevenseacat: heroku doesnt support sqlite
[03:12:53] CuriousMind: sevenseacat: Oh I see
[03:13:13] sevenseacat: you'll need to swap to using postgres for production, or better yet, postgres for all environments.
[03:14:20] CuriousMind: sevenseacat: I do have postgres for production. Here is my Gemfile. https://github.com/Osagiede/sample_app/blob/master/Gemfile
[03:14:38] CuriousMind: I am using sqlite for development.
[03:14:53] CuriousMind: Why am I doing this? I am following an online guide. https://www.railstutorial.org/book/static_pages
[03:15:43] sevenseacat: https://github.com/Osagiede/sample_app/blob/master/config/database.yml your database.yml isnt configured to use postgres in production
[03:18:10] CuriousMind: sevenseacat: That makes sense. I don't know how to do this though. I guess refer to the ruby guides online
[03:18:17] sevenseacat: this chapter seems like a bit of a mess
[03:19:04] CuriousMind: sevenseacat: I'm just trying to learn rails and I couldn't continue this chapter for two weeks cause of this problem
[03:19:07] sevenseacat: maybe heroku is doing something weird - lemme look into it
[03:19:35] CuriousMind: sevenseacat: Ok thanks. In the meanwhile, I'll search for how to configure my database.yml file
[03:21:14] sevenseacat: shouldnt need to configure it for heroku - checked it against a sample app I have that deploys to heroku
[03:22:18] CuriousMind: sevenseacat: I see
[03:22:29] za1b1tsu: has joined #RubyOnRails
[03:26:34] CuriousMind: If I d/c, I'll be back sevenseacat
[03:33:00] akaiiro: has joined #RubyOnRails
[03:34:52] sevenseacat: trying to get the new heroku client set up here so I can try deploying your sample app
[03:35:14] CuriousMind: Ok no problem sevenseacat
[03:40:13] sevenseacat: looks ok here - https://sample-app-rails-52.herokuapp.com/
[03:40:22] sevenseacat: do you have some code locally that isnt on github?
[03:41:50] CuriousMind: sevenseacat: Hmm..
[03:42:10] CuriousMind: I'm not sure, let me see
[03:42:15] sevenseacat: can you push your latest committed code to github
[03:42:34] CuriousMind: sevenseacat: Yes I will, one second
[03:42:51] CuriousMind: I just modified the database.yml. Should I undo the change?
[03:43:10] sevenseacat: yeah, you don't need to do that
[03:43:43] CuriousMind: Everything is up to date
[03:44:29] CuriousMind: sevenseacat: I disabled bootsnap and I created a schema like 10 minutes ago
[03:44:38] chouhoulis: has joined #RubyOnRails
[03:45:16] CuriousMind: I did that cause I was trying to do rake:db setup
[03:45:57] sevenseacat: that code still deployed fine here :/ whats going on with your setup
[03:46:17] sevenseacat: can you try deploying again?
[03:46:47] CuriousMind: Everything up-to-date
[03:47:08] CuriousMind: I guess I should just start over again right
[03:47:32] sevenseacat: everything up to date? but you had a new commit
[03:47:50] CuriousMind: Then I pushed after
[03:48:09] sevenseacat: and what happened then
[03:48:24] CuriousMind: Still doesn't work. https://rocky-ravine-35505.herokuapp.com/
[03:48:43] sevenseacat: what did the output of deploying look like, any errors?
[03:49:31] CuriousMind: The third line of heroku logs says "Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? sqlite3 is not part of the bundle. Add it to your Gemfile. (Gem::LoadError)"
[03:50:13] CuriousMind: Not third, second line sorry. Here is the full line - "/app/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/rubygems_integration.rb:377:in `block (2 levels) in replace_gem': Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? sqlite3 is not part of the bundle. Add it to your Gemfile. (Gem::LoadError)"
[03:50:13] sevenseacat: thatscool, but I asked about the deploy
[03:50:33] CuriousMind: OH gotchya sorry
[03:51:06] CuriousMind: sevenseacat: remote: Verifying deploy... done. To https://git.heroku.com/rocky-ravine-35505.git c0b5aea..6bc3713 master -> master
[03:51:14] CuriousMind: Seems like everything went ok
[03:56:48] sevenseacat: I'm not sure whats going on there. it works here :(
[03:57:17] CuriousMind: sevenseacat: It's alright. I have one more question
[03:58:14] CuriousMind: As you can see, I am trying to learn rails. Besides from guides.rubyonrails.org. What else is a good resource that I could start learning and practicing from?
[03:58:42] CuriousMind: Rails is complicated to me and I am trying to learn all the different options and purposes of the different files and how to configure this and that etc
[03:59:02] sevenseacat: I co-wrote what I think is a good resource, but it never got updated for Rails 5 :/
[03:59:04] CuriousMind: I just finished an SQL tutorial today. I did http://www.sqlcourse2.com/other_links.html. I'm trying to get it together
[04:00:01] CuriousMind: sevenseacat: What was the resource you suggested?
[04:00:04] sevenseacat: I don't know what other resources out there - I think railstutorial got a bit whacky
[04:00:09] helpa: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[04:00:46] sevenseacat: wahey I'm listed first now, not sure when that happened
[04:01:12] CuriousMind: A free resource I mean
[04:02:04] sevenseacat: thats a trickier question
[04:03:40] CuriousMind: sevenseacat: If you don't know, it's ok. Let me know
[04:05:08] CuriousMind: sevenseacat: Ok, I'm going to go. Thanks for the help
[04:08:42] jcarl43: has joined #RubyOnRails
[04:11:16] iAmDecim: has joined #RubyOnRails
[04:14:20] vedu_: has joined #RubyOnRails
[04:14:35] iAmDecim: has joined #RubyOnRails
[04:18:02] workmad3: has joined #RubyOnRails
[04:34:17] quazimodo: has joined #RubyOnRails
[04:43:45] agent_white: has joined #RubyOnRails
[04:54:30] za1b1tsu: has joined #RubyOnRails
[05:14:10] quazimodo: has joined #RubyOnRails
[05:18:48] bbobb: has joined #RubyOnRails
[05:23:57] vedu_: has joined #RubyOnRails
[05:24:49] za1b1tsu: has joined #RubyOnRails
[05:28:14] quazimodo: has joined #RubyOnRails
[05:28:47] reber: has joined #RubyOnRails
[05:32:05] dionysus69: has joined #RubyOnRails
[05:52:48] conta: has joined #RubyOnRails
[06:06:06] za1b1tsu_: has joined #RubyOnRails
[06:09:44] braindead_: has joined #RubyOnRails
[06:16:20] sandstrom: has joined #RubyOnRails
[06:18:45] workmad3: has joined #RubyOnRails
[07:14:43] drale2k_: has joined #RubyOnRails
[07:22:47] ellcs: has joined #RubyOnRails
[07:35:12] sandstrom: has joined #RubyOnRails
[07:51:14] srinidhi: has joined #RubyOnRails
[07:54:41] sandstrom: has joined #RubyOnRails
[08:02:54] mikecmpbll: has joined #RubyOnRails
[08:06:11] ellcs: has joined #RubyOnRails
[08:06:29] jottr: has joined #RubyOnRails
[08:19:31] workmad3: has joined #RubyOnRails
[08:49:37] workmad3: has joined #RubyOnRails
[08:54:10] mauro1254: has joined #RubyOnRails
[08:54:29] kapil___: has joined #RubyOnRails
[09:01:58] mikecmpbll: has joined #RubyOnRails
[09:07:46] za1b1tsu: has joined #RubyOnRails
[09:10:47] tekk: has joined #RubyOnRails
[09:10:57] ur5us: has joined #RubyOnRails
[09:11:44] jottr: has joined #RubyOnRails
[09:26:38] hfp_work: has joined #RubyOnRails
[09:37:07] jottr: has joined #RubyOnRails
[09:40:18] srinidhi: has joined #RubyOnRails
[09:43:24] conta: has joined #RubyOnRails
[09:58:07] RougeR: has joined #RubyOnRails
[10:00:50] RougeR: https://gist.github.com/CodePint/dd39072d9859a26d18f18e7dbb7526f3
[10:00:57] RougeR: still not been able to do thids
[10:02:14] sevenseacat: @climbs.joins(:route).where(routes: { gym_id: @gym.id })
[10:07:02] RougeR: ahh i might have been close
[10:07:10] RougeR: i didnt specify route in the where query
[10:18:52] RougeR: thanks for your help sevenseacat fyi.
[10:31:55] ur5us: has joined #RubyOnRails
[10:33:34] weird_error: has joined #RubyOnRails
[10:39:38] srinidhi: has joined #RubyOnRails
[10:46:36] drale2k_: has joined #RubyOnRails
[10:46:47] drale2k_: Is it save to pass a param directly to AR .where? Like Computer.where(id: params[:computer_id])
[10:47:00] papajo: has joined #RubyOnRails
[10:47:05] Radar: drale2k_: yes in that case it is fine. Interpolation is usually where it goes wrong.
[10:47:49] drale2k_: Radar: thanks, so Computer.where(id: #{computer_id}) could be a problem
[10:48:00] papajo: has left #RubyOnRails: ()
[10:48:03] Radar: drale2k_: Computer.where("id = #{computer_id}"), but yeah
[11:08:20] tbuehlmann: drale2k_, just so you know: when passing an ActionController::Parameters object into .where directly and a key is not permitted, rails will raise an ActiveModel::ForbiddenAttributesError
[11:10:37] fmcgeough: has joined #RubyOnRails
[11:15:28] drale2k_: tbuehlmann: thanks know that, but ID and any foreign keys should be allowed by default right ?
[11:16:57] tbuehlmann: key-value pairs in AC::Parameters are not permitted until you manually permit it
[11:32:27] Ericx2x: has joined #RubyOnRails
[11:43:09] mguex: has joined #RubyOnRails
[11:46:17] mguex: o/ I use ror5 with active storage and have several pages that have their routes configured in the db. The controller finds the page by the route. Slashes are a requirement (e.g. "/foo/bar"). So in routes.rb I got "get '/*route', :to => "page#show", :as => :show_page". This works as expected, however the activestorage routes under /rails are also caught by it. Any idea how to fix this?
[11:46:37] Ericx2x: has joined #RubyOnRails
[11:47:09] mguex: I already tried copy pasting the routes of active storage above the catch all which gives me errors that the routes are already defined
[11:48:23] mguex: One idea I had was to move the activestorage route initializer in front of the one of my app (I assume it is currently executed after routes.rb of my application), however I don't know how to change that
[11:49:41] mguex: another solution would be to have the "get '/*route'..." except for "/rails/"
[11:50:47] tbuehlmann: mguex: not sure the latter is possible with a string pattern, but it's easily possible with a custom constraint
[11:51:14] mguex: tbuehlmann: thanks
[11:51:40] mguex: I am currently trying to come up with a regex
[11:51:55] mguex: seems to work
[11:52:26] tbuehlmann: a constraint could look like this: https://gist.github.com/tbuehlmann/b8d28c3ca46c33fb96aeb6922572ce6e
[11:52:30] mguex: for reference: get '/*route', :to => "page#show", :as => :show_page, :route => /(?!.*rails).*/
[11:52:40] tbuehlmann: ah, wonderful
[11:54:55] mguex: however the regex will also match /railsblog or something similiar
[11:55:21] mguex: I prefer your solution as it does not require regex magic
[11:58:58] mguex: tbuehlmann: curl https://gist.githubusercontent.com/tbuehlmann/b8d28c3ca46c33fb96aeb6922572ce6e/raw/c2661d09b0d0056f4e4085fd15572b3e992e4a7b/not_starting_with_rails_constraint.rb | sed -e 's/\/rails/\/rails\//g'
[11:59:01] mguex: works for me
[12:01:16] apparition47: has joined #RubyOnRails
[12:02:41] za1b1tsu: has joined #RubyOnRails
[12:03:57] za1b1tsu: Hello if anyone is using RubyMine, is there a built-in way to open a gem as a project?
[12:07:56] psychoslave: has joined #RubyOnRails
[12:14:06] mauro1254: za1b1tsu : Hello
[12:14:40] mauro1254: za1b1tsu : you can fork the project repo, clone it and then work on it
[12:15:45] fmcgeough: has joined #RubyOnRails
[12:15:57] mauro1254: Hi folks, is there a gem that et you consume json web services and create associations with ActiveRecord models? Looked at ActiveResource and Her, but unfortunately association to AR models is not supported.
[12:22:58] elsurudo: has joined #RubyOnRails
[12:28:13] drale2k_: has joined #RubyOnRails
[12:28:34] syndikate: Is there a way to put a unique constraint/index on a specific value? As in I need the unique index on two fields when one of the field has a specific value
[12:28:58] syndikate: I have put this at a model level. Is it possible at Database level?
[12:29:33] psychoslave_: has joined #RubyOnRails
[12:45:38] kapil___: has joined #RubyOnRails
[13:03:34] syndikate: Putting it in another way how can I created a conditional unique constraint
[13:12:46] conta1: has joined #RubyOnRails
[13:14:12] elsurudo: has joined #RubyOnRails
[13:43:05] defsdoor: has joined #RubyOnRails
[13:52:52] vedu_: has joined #RubyOnRails
[14:04:26] za1b1tsu: has joined #RubyOnRails
[14:06:32] dviola: has joined #RubyOnRails
[14:07:53] snickers: has joined #RubyOnRails
[14:21:40] Dbugger: has joined #RubyOnRails
[14:39:50] vedu_: has joined #RubyOnRails
[15:03:08] Inside: has joined #RubyOnRails
[15:03:23] chouhoulis: has joined #RubyOnRails
[15:10:02] workmad3: has joined #RubyOnRails
[15:10:58] cjohnson: syndikate: Well presumably you would need to join the database channel for the relevant DBMS you're using and ask there
[15:20:28] tcopeland: has joined #RubyOnRails
[15:22:57] mguex: syndikate: http://api.rubyonrails.org/classes/ActiveModel/Validations/ClassMethods.html#method-i-validates
[15:23:16] mguex: see the :if method
[15:26:45] Travis-42: I'm trying to use the rails cache helper when building a large xml response for a feed, but if I use caching, memory usage quickly grows out of bounds by hundreds of megabytes per request -- almost all on this line of the rails cache helper when writing an uncached fragment "fragment = output_buffer.slice!(pos..-1)" -- is there a more efficient way of caching fragments of xml responses?
[15:27:19] troys: has joined #RubyOnRails
[15:29:05] mguex: syndikate: https://0bin.net/paste/+Rro9EorzIu23qKI#avj4mT5xmYzh1TMaT77e3x6G029euV3DnhuAyrLouZ6
[15:29:07] mguex: not tested
[15:39:12] jcarl43: has joined #RubyOnRails
[15:50:18] dbugger__: has joined #RubyOnRails
[15:59:19] desperek: has joined #RubyOnRails
[16:01:35] kapil___: has joined #RubyOnRails
[16:04:13] p8m: has joined #RubyOnRails
[16:14:29] darkhanb: has joined #RubyOnRails
[16:46:01] akaiiro: has joined #RubyOnRails
[16:47:38] j0bk: has joined #RubyOnRails
[16:52:01] vedu_: has joined #RubyOnRails
[16:52:36] dionysus69: has joined #RubyOnRails
[16:53:51] orbyt_: has joined #RubyOnRails
[16:56:32] workmad3: has joined #RubyOnRails
[17:10:17] jottr: has joined #RubyOnRails
[17:10:56] Cork: has joined #RubyOnRails
[17:16:22] ellcs: has joined #RubyOnRails
[17:17:24] wilornel: has joined #RubyOnRails
[17:20:46] FernandoBasso: has joined #RubyOnRails
[17:22:59] jottr: has joined #RubyOnRails
[17:24:26] orbyt_: has joined #RubyOnRails
[17:27:02] orbyt_: has joined #RubyOnRails
[17:39:42] wmoxam: has joined #RubyOnRails
[17:41:45] psychoslave: has joined #RubyOnRails
[17:45:34] apeiros__: has joined #RubyOnRails
[17:46:43] lxsameer: has joined #RubyOnRails
[17:46:59] hellekin: has joined #RubyOnRails
[17:47:09] sandstrom: has joined #RubyOnRails
[17:50:54] sameerynho: has joined #RubyOnRails
[17:55:12] Ryzokuken: has joined #RubyOnRails
[18:05:22] mikecmpbll: has joined #RubyOnRails
[18:16:07] dbugger_: has joined #RubyOnRails
[18:16:26] shenghi: has joined #RubyOnRails
[18:19:39] mtkd: has joined #RubyOnRails
[18:21:26] fcser_: has joined #RubyOnRails
[18:22:58] psychoslave: has joined #RubyOnRails
[18:26:02] psychoslave: has joined #RubyOnRails
[18:38:36] agent_white: has joined #RubyOnRails
[18:53:04] ellcs: has joined #RubyOnRails
[18:53:09] za1b1tsu: has joined #RubyOnRails
[19:03:49] jottr: has joined #RubyOnRails
[19:14:08] Kestrel-029: has joined #RubyOnRails
[19:16:46] DrYockel: has joined #RubyOnRails
[19:17:49] DrYockel: has joined #RubyOnRails
[19:33:42] Puffball: has joined #RubyOnRails
[19:34:27] za1b1tsu: has joined #RubyOnRails
[19:36:10] orbyt_: has joined #RubyOnRails
[19:39:29] dbugger__: has joined #RubyOnRails
[19:48:29] workmad3: has joined #RubyOnRails
[19:49:09] ellcs: has joined #RubyOnRails
[19:53:13] mauro1254: has joined #RubyOnRails
[19:53:44] mauro1254: Hi folks, is there a gem that et you consume json web services and create associations with ActiveRecord models? Looked at ActiveResource and Her, but unfortunately association to AR models is not supported.
[20:02:22] chouhoulis: has joined #RubyOnRails
[20:05:39] orbyt_: has joined #RubyOnRails
[20:11:36] Ergo: has joined #RubyOnRails
[20:21:25] chouhoulis: has joined #RubyOnRails
[20:43:11] jottr: has joined #RubyOnRails
[20:48:02] ur5us: has joined #RubyOnRails
[20:50:25] jcarl43: has joined #RubyOnRails
[20:57:35] uks: has joined #RubyOnRails
[21:00:58] tekk: has joined #RubyOnRails
[21:02:30] baczy: has joined #RubyOnRails
[21:05:51] ur5us: has joined #RubyOnRails
[21:18:21] johndunn: has joined #RubyOnRails
[21:22:33] za1b1tsu: has joined #RubyOnRails
[21:42:53] orbyt_: has joined #RubyOnRails
[21:49:12] workmad3: has joined #RubyOnRails
[21:49:42] fmcgeough: has joined #RubyOnRails
[21:51:05] jottr: has joined #RubyOnRails
[22:03:55] agent_white: has joined #RubyOnRails
[22:08:57] moei: has joined #RubyOnRails
[22:18:21] weaksauce: has joined #RubyOnRails
[22:24:19] Inside: it's so quiet in here
[22:24:33] Inside: Topic for discussion: ruby needs monads
[22:24:44] Inside: Ruby 2.7 milestone perhaps?
[22:27:30] fmcgeough: has joined #RubyOnRails
[22:27:52] kt: has joined #RubyOnRails
[22:42:45] chouhoulis: has joined #RubyOnRails
[22:45:37] baweaver: dminuoso: tag, you're it
[22:47:00] chouhoulis: has joined #RubyOnRails
[22:52:39] chouhoulis: has joined #RubyOnRails
[22:53:26] orbyt_: has joined #RubyOnRails
[22:58:07] chouhoulis: has joined #RubyOnRails
[23:03:35] chouhoulis: has joined #RubyOnRails
[23:09:13] chouhoulis: has joined #RubyOnRails
[23:10:34] za1b1tsu: has joined #RubyOnRails
[23:13:40] Radar: Inside: dry-monads gem
[23:13:42] Radar: next question
[23:13:53] ellcs: has joined #RubyOnRails
[23:19:59] chouhoulis: has joined #RubyOnRails
[23:20:10] cschneid: has joined #RubyOnRails
[23:25:34] chouhoulis: has joined #RubyOnRails
[23:28:11] nickenchuggets: has joined #RubyOnRails
[23:31:00] chouhoulis: has joined #RubyOnRails
[23:31:27] tdy: has joined #RubyOnRails
[23:31:53] quazimodo: has joined #RubyOnRails
[23:34:03] kt: has joined #RubyOnRails
[23:36:30] chouhoulis: has joined #RubyOnRails
[23:41:56] chouhoulis: has joined #RubyOnRails
[23:47:22] chouhoulis: has joined #RubyOnRails
[23:49:51] workmad3: has joined #RubyOnRails
[23:53:23] johndunn: has left #RubyOnRails: ()
[23:53:35] dblessing: has joined #RubyOnRails