Bundler: You must use Bundler 2 or greater with this lockfile

I had a similar experience. Here’s how I solved it Display a list of all your local gems for the bundler gem N/B: The command above is for rbenv version manager, the one for rvm might be different This will display the versions of the bundler gem installed locally Note: Your versions might differ from … Read more

Getting error: Peer authentication failed for user “postgres”, when trying to get pgsql working with rails

The problem is still your pg_hba.conf file*. This line: Should be: * The location of this file isn’t very consistent. The command locate pg_hba.conf should help; here’s some examples: /etc/postgresql/*/main/pg_hba.conf and /var/lib/pgsql/data/pg_hba.conf. After altering this file, don’t forget to restart your PostgreSQL server. If you’re on Linux, that would be sudo service postgresql restart. These are brief descriptions of both options according to … Read more

Rails: Can’t verify CSRF token authenticity when making a POST request

Cross site request forgery (CSRF/XSRF) is when a malicious web page tricks users into performing a request that is not intended for example by using bookmarklets, iframes or just by creating a page which is visually similar enough to fool users. The Rails CSRF protection is made for “classical” web apps – it simply gives a degree … Read more

what does ? ? mean in ruby

Functions that end with ? in Ruby are functions that only return a boolean, that is, true, or false. When you write a function that can only return true or false, you should end the function name with a question mark. The example you gave shows a ternary statement, which is a one-line if-statement. .nil? is a boolean … Read more