PG::InvalidParameterValue: ERROR: invalid value for parameter “client_min_messages”: “panic”

To make it work with PostgreSQL version 12, I monkey patched PostgreSQLAdapter class to replace ‘panic’ with ‘warning’ message. Note, if you can upgrade activerecord gem to 4.2.6 or higher versions you don’t need to have this monkey patch. I had to do this because my project depends on gem activerecord-3.2.22.5 require ‘active_record/connection_adapters/postgresql_adapter’ class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter …

Read more

Understanding Gemfile.lock: Is it okay to delete Gemfile.lock then run bundle install again?

You’re probably not going to ruin your dev environment. However, you might end up with newer versions of gems than you had before. It depends on how you have defined them in Gemfile. If you’re using entries like: gem “rails” Then you’ll get the latest rails gem, whatever that might be. If you’re using entries …

Read more

You don’t have [PATH ]in your PATH, gem executables will not run.” while using “gem install –user-install bundler

For those who have problems with @lamech-desai answer, (actually, when they do Desai’s commands, it apparently works temporarily for them). So you can easily do these: open ~/.bashrc if you would like to use bash or ~/.zshrc if your are using zsh or etc… $ nano .bashrc ## bash users $ nano .zshrc ## zsh …

Read more

How to modify a Ruby gem

Download its source code into a separate folder (perhaps from github). Then modify your Gemfile to point to the source directly so that you can edit it and test your changes directly. For example, let’s say that you want to edit the secure_headers gem and that you’ve cloned it into ~/workspace/secureheaders. Then you can use …

Read more

require ‘rubygems’

require ‘rubygems’ will adjust the Ruby loadpath allowing you to successfully require the gems you installed through rubygems, without getting a LoadError: no such file to load — sinatra. From the rubygems-1.3.6 documentation: When RubyGems is required, Kernel#require is replaced with our own which is capable of loading gems on demand. When you call require …

Read more