緣起 因為要讓單一機器正常運作多個 Rails app 且互不干擾,閱讀這篇文章 https://codepany.com/blog/rails-5-and-docker-puma-nginx/ 的內容後,決定採用第六種作法:Rails app in docker and web server at host environment (文章內容是 Dockerize Rails app into
read more緣起 因為要讓單一機器正常運作多個 Rails app 且互不干擾,閱讀這篇文章 https://codepany.com/blog/rails-5-and-docker-puma-nginx/ 的內容後,決定採用第六種作法:Rails app in docker and web server at host environment (文章內容是 Dockerize Rails app into
read more緣起 我喜歡做 Rails app prototype 放在 Digital Ocean,Rails app A 5.2.0 已經部署在上面,最近想再部署其他小型 Rails app 到同一臺機器上,但發現部署其他小型 Rails app B 到相同正
read more用 Docker + Docker-compose 建立自己寫的Rails app 運作的開發和正式環境,我的心得是,開發者要逐步建立自己的常用工具和套件,怎樣讓自己的做事更順暢,就像水電工有
read moreJavaScript 初學者必讀文章,用來熟悉 JS 觀念: 深入了解物件模型 https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Guide/Details_of_the_Object_Model 繼承與原型鍊 https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Inheritance_and_the_prototype_chain 箭頭函式 https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Functions/Arrow_functions __proto__, prototype 的差異 https://medium.com/@peterchang_82818/javascripter-%E5%BF%85%E9%A0%88%E7%9F%A5%E9%81%93%E7%9A%84%E7%B9%BC%E6%89%BF%E5%9B%A0%E5%AD%90-prototype-prototype-proto-object-class-inheritace-nodejs-%E7%89%A9%E4%BB%B6-%E7%B9%BC%E6%89%BF-54102240a8b4 查 js 和 css 在各瀏覽器的可用情況 https://caniuse.com/ bind() 用法 ,常見和 this 關鍵字
read moreIn Gemfile: # Use Capistrano for deployment group :development do gem 'capistrano' gem 'capistrano-passenger' gem 'capistrano-rails' gem 'capistrano-bundler' gem 'capistrano-rvm' gem 'highline' end In deploy.rb # Set rvm type #set :rvm\_type, :user set :rvm\_custom\_path, '/usr/local/rvm' # Remote server using rvm set :rvm\_ruby\_version, '[email protected]' In config/environment/production.rb config.require_master_key = true
read moreWhen I deploying a new rails 5.2.0 app to production machine, which has been the other rails 5.2.0 app there, I encounter a serious problem: ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage ArgumentError: invalid base64 /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing' /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/application.rb:433:in `secret_key_base' Below are a part of debug info when I use capistrano to deploying a rails 5.2.0 app: DEBUG [b79779f0] Command: cd /var/www/blogApp/releases/20180802145508 && ( export RAILS_ENV="production" RAILS_GROUPS="" ; /usr/local/rvm/bin/rvm [email protected] do bundle exec rake assets:precompile )
read more