#RubyOnRails - 14 September 2018
« Back 1 day Forward 1 day »
[05:59:01] tbuehlmann: sevenseacat: I failed the other day and went back to just yarn packages in my rails app :\
[06:00:00] sevenseacat: looking at an existing large app thats got a mix of all kinds of fronted stuff in it, aiming to standardise it all
[08:30:34] dionysus69: I get this error during deployment, any suggestions appreciated, I cant really get what's going wrong. http://paste.debian.net/1042156/
[08:36:27] dionysus69: hmm I dont know, it was there for past year, just got a problem, I will try without it :)
[08:38:21] dionysus69: interestingly, this happens right during assets precompile step of deployment
[08:40:02] dionysus69: No connection pool with 'primary' found. (ActiveRecord::ConnectionNotEstablished)
[08:40:22] dionysus69: so seems you were right, some problem with database but on the other branch it worked
[08:44:36] dionysus69: so when I turn off postgresql service it returns the same error so I guess it cannot even detect database's existence
[08:53:44] dionysus69: sevenseacat: strange, I did git reset --hard HEAD~1 and git is set to the same commit, maybe a git problem
[08:56:01] dionysus69: so initializer had to be a problem, I have an empty initializer file and I didnt really know or remember that I cannot do that, I just thought the file would just get loaded and not expect class statement to be uncommented
[08:59:08] dionysus69: yea actually no, it fixes local but not the capistrano deployment, weird stuff
[10:12:03] Terens: Would you use a concern for sending SMS or you would create a service / something else?
[10:12:36] Terens: In my current app there is a concern smsable but I am not sure if this has any downsides
[10:31:35] sheepman: quick one, a method that iterates over all my model entries should go in the controller rather then the model presumably?
[10:32:48] sheepman: it loads a list of IP's and adds/removes any from the model to keep them in sync
[10:34:55] tbuehlmann: I wouldn't place such a method in the controller. I'd either put it in the corresponding model or have an interactor/service for it
[10:46:18] sheepman: also turned out having a model named Proxies is a bad idea but i couldn't see that in any docs
[11:05:20] sheepman: I.e. NoMethodError (undefined method `reload_servers' for Proxy (call 'Proxy.connection' to establish a connection):Class)
[11:32:17] charlielor: Is <%= ENV["SECRETE_KEY_BASE_DEV"] %> the correct way to retrieving value from a .env file?
[12:12:10] charlielor: In my secrets.yml file I have secret_key_base: <%= ENV["SECRETE_KEY_BASE_DEV"] %>. Is this the proper way of retrieving environment value from a .env file because it’s not working.
[12:12:47] charlielor: This is the error I kept getting: Missing `secret_key_base` for 'development' environment, set this value in `config/secrets.yml`
[12:18:33] charlielor: in my database.yml I use <%= ENV.fetch('PG_HOST', 'localhost') %> instead but I also tried this syntax on secrets.yml and it’s not working there
[12:18:48] charlielor: I can vefify that it works in database.yml because if I take those values out, my site don’t load
[12:19:34] tbuehlmann: PG_HOST might be set "outside" of your rails application and is therefore available inside the process
[12:19:35] charlielor: wait, maybe you’re right…perhaps it’s not working..and only falling back to the default since my syntax does specified the default
[12:20:53] charlielor: okay, so to get this to work, I just have to get the dotenv or dotenv-rails gem. What’s the different between these two?
[12:25:25] tbuehlmann: it adds some juice like mentioned here: https://github.com/bkeepers/dotenv#note-on-load-order
[13:36:13] charlielor: Okay, so after installed the gem dotevn and set require ‘dotevn/load’ in my applicatoin.rb file and specified Dotenv::Railtie.load in the class Application <Rails::Application, I got this error when run the application: /app/config/application.rb:23:in `<class:Application>': uninitialized constant Dotenv::Railtie (NameError)
[14:08:38] charlielor: tbuehlmann: I’m following the instruction here https://github.com/bkeepers/dotenv#note-on-load-order
[14:33:54] charlielor: tbuehlmann: do I need to put gem 'dotenv-rails' inside the group :development, :test ?
[14:34:43] charlielor: In the database.yml file, is this the correct syntax? <%= ENV.fetch('PG_HOST', 'localhost') %>
[14:36:25] dionysus69: sevenseacat: https://qiita.com/masayuki14/items/27ca4764d0bcae4affea just left to translate it :D it is 4 days old so it has to be something that has changed recently
[16:05:17] srruby: Any thoughts on engineyard? Is there a big advantage of heroku or engineyard over my own vps? I'm starting a project that is paying hundreds per month for engineyard for a rails server that gets only moderate use
[21:08:01] npx: I've just added "etc" to my Gemfile but I've got this whole kubernetes ci/cd thing I'm kinda concurrently hacking on so we shall see hahah
[22:44:34] i8igmac: im trying to add jquery.treeview to incorporate with ace editor so i can make changes to the currently running rails app from a webbrowser
[23:33:01] i8igmac: or maybe, any ide's that run in the browser that would give me a tree view of the server