So, we set up a project on a new Digital Ocean droplet and the cron jobs started failing.
Not just that, the log file that we had set up to track the cron was showing up empty!
After a lot of head scratching, I had a look at /var/log/syslog
So, we set up a project on a new Digital Ocean droplet and the cron jobs started failing.
Not just that, the log file that we had set up to track the cron was showing up empty!
After a lot of head scratching, I had a look at /var/log/syslog
Whenever I get this error, I have to again do a google search. So, this post is for me not to do that again!
Could not find 'bundler' (2.1.4) required by your .Gemfile.lock. (Gem::GemNotFoundException) To update to the latest version installed on your system, run `bundle update --bundler`. To install the missing version, run `gem install bundler:2.1.4`
Unfortunately, the suggestions don’t quite work.
The correct way to fix this is to run these three commands:
gem install --default bundler gem update --system bundler update --bundler
Courtesy of StackOverflow. (The correct answer on StackOverflow didn’t quite work either!)
After having created the directory monitor, I realized that it would not be suitable for everything.
For example, if I needed to know which file was getting modified in the directory, rather than just anything having gotten modified.
Well, in that case we would somehow need to store both the file name and the modified time of the file which changed.
Continue readingThere have been many times over the years that I’ve been wanting a simple capability of monitoring changes in some directory or some files in my system.
Linux has inotify and Windows has WatchDirectory.
The biggest challenge has been to look for something that works seamlessly across operating systems.
So, I thought of creating my own solution!
Continue readingWhat a fantastic module!
Every once in a while I get to know a bit more of Ruby and I feel the joy which Matz talks about!
From: The Philosophy of Ruby –
For me the purpose of life is partly to have joy. Programmers often feel joy when they can concentrate on the creative side of programming, So Ruby is designed to make programmers happy.
Today I was looking for executing a program from within Ruby. Now this program takes command line input and gives some output as well. So, I went around trying the usual %x(program.rb)
but obviously that didn’t work.
Finally I came across Open3 which is a core module of Ruby!
Continue readingClasses and Modules in ruby have always intrigued me!
So, I thought I’ll write some code to understand what they were.
Besides the standard Class aspects of ruby, there are a lot of interesting things that can be done with them – like singleton objects.
Modules, of course, give another level of flexibility.
Continue readingrvm or the Ruby Version Manager, works perfectly fine when there is a single version of Ruby to be run on the system (among multiple versions installed, of course) around the entire system. In a production scenario, updating ruby itself is a task which is not taken lightly!
This worked perfectly until I encountered two quite different situations –
One scenario was where I wanted to execute a command via ssh
into the server. So something like –
ssh user1@server1 'ruby ~/program.rb'
The other being when I wanted to run a ruby program via cron
In both these cases, I kept getting the error rvm not found
. Initially, I couldn’t understand this at all, because every time I logged in and ran the program or the command it would run prefectly.
And then I learnt about the difference between a login and a non-login shell.
Continue readingCopyright © 2024 the möbius trip
Theme by Anders Noren — Up ↑