Automate GitHub API Calls With Ruby, Keyboard Maestro, and 1Password CLI
Moncef Belyamani
by Moncef Belyamani
1y ago
One of the perks of the “Ultimate” version of Ruby on Mac is access to the private GitHub repo. As a developer — especially one who loves automation — it was tempting to try to completely automate inviting new Ultimate customers to the repo. To do that would require implementing a custom checkout that captures the customer’s GitHub username, so I can then pass it on to the Paddle checkout flow. Paddle unfortunately doesn’t support adding custom fields to their checkout. From there, I would only need to add a few lines of code to my existing small Rails app that receives the Paddle webhook. I’m ..read more
Visit website
Rails is not currently installed on this system: how to fix this error
Moncef Belyamani
by Moncef Belyamani
2y ago
Did you just install Rails on your Mac, but got “Rails is not currently installed on this system” when you tried to use it? Depending on how you installed Rails, the fix could be easy or complicated. Whatever you do, please don’t follow the instructions to simply type sudo gem install rails. Learn why you should never use sudo to install gems. Here are four ways to fix the error “Rails is not currently installed on this system”: Quit and restart Terminal (easy) Install Rails again (easy) Update your PATH (time-consuming and complicated) Install Ruby with chruby and ruby-install Quit and rest ..read more
Visit website
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory
Moncef Belyamani
by Moncef Belyamani
2y ago
If you’re reading this, you’ve probably been trying to install a Ruby gem on your Mac (such as Rails, Jekyll, or cocoapods), but you got this write permissions error: ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory This is one of the most common errors people face. You’ll get this error for any gem you try to install on a Mac that hasn’t yet been properly configured for Ruby development. Apple preinstalls Ruby on all Macs, and the default location where gems would get installed is in the /Library/Ruby/Gems ..read more
Visit website
How to fix undefined local variable or method `d' for Gem::Specification:Class
Moncef Belyamani
by Moncef Belyamani
2y ago
If you’re seeing a weird invalid gemspec error that looks like this: Invalid gemspec in [~/.gem/ruby/2.7.4/specifications/jekyll-4.2.1.gemspec]: undefined local variable or method `d' for Gem::Specification:Class or this: Invalid gemspec in [~/.gem/ruby/2.7.4/specifications/rails-7.0.0.gemspec]: undefined local variable or method `d' for Gem::Specification:Class or this: Invalid gemspec in [~/.gem/ruby/3.0.3/specifications/bundler-2.2.32.gemspec]: undefined local variable or method `d' for Gem::Specification:Class ERROR: While executing gem ... (NoMethodError) undefined method ..read more
Visit website
Techniques For Improving Your Coding Skills
Moncef Belyamani
by Moncef Belyamani
2y ago
The other day, I came across a tech newsletter where the author challenges people to solve a coding problem in the “interview question of the week” section. Here’s an example: You’re given two integer arrays (n and m), and an integer k. Using the digits from n and m, return the largest number you can of length k. Example: n = [3,4,6,5] m = [9,0,2,5,8,3] k = 5 $ maxNum(n, m, k) $ 98655 The following week, the author linked to 42 responses, and praised them all equally with “awesome work.” Looking through the submissions, I noticed that most made the same assumptions, some were incorrect, and ..read more
Visit website
7 Changes I Made to Get My Site to a Perfect Lighthouse Score
Moncef Belyamani
by Moncef Belyamani
2y ago
Last year, Google announced that “page experience” would start affecting their search ranking. This update is meant to highlight pages that offer “great user experiences”, such as loading quickly and following best practices. They are rolling this out gradually in mid-June, so I’ve been making small improvements to my site over the past month, and I went from an 86 for the Web Vitals to a perfect 100 across all 4 areas that Google’s Lighthouse tool measures: Performance, Accessibility, Best Practices, and SEO. ? Below are the seven specific changes I made recently to get the Lighthouse firewor ..read more
Visit website
How To Install Homebrew, Ruby, Rails, Jekyll On A Mac With The M1 (Apple Silicon) Chip
Moncef Belyamani
by Moncef Belyamani
2y ago
Instead of boring you with the background history that I was starting to write, I realized it can all be summarized to these 3 points: Most blog posts you might have read before this one are outdated or contain incorrect information and bad advice. Homebrew works natively on M1 Macs now (for all common tools needed for Ruby development), so you don’t need to use Rosetta. If you made any changes to your shell file so that it runs commands using arch -x86_64, you can undo them. Similarly, if you are prepending all your commands with arch -x86_64, you don’t need to do that anymore. The easiest w ..read more
Visit website
The 6 Characters That Could Bring Down Your Rails App
Moncef Belyamani
by Moncef Belyamani
2y ago
It all started with a ping from one of the team leads who noticed a recurring exception in Sentry. At the same time, DataDog showed the Postgres CPU utilization was spiking. Based on the Sentry logs, the team lead thought this exception was caused by a specific deploy, but they couldn’t find anything in the most recent commits. Then they asked me to look into it. I was new to this project, so I had the fresh eyes benefit. The first thing I did was look at the exception in Sentry, which pointed to the problematic line of code, which had been introduced about a year earlier. I immediately knew w ..read more
Visit website

Follow Moncef Belyamani on FeedSpot

Continue with Google
Continue with Apple
OR