7 posts about #command-line

BUILD FAILED (OS X 11.0.1 using python-build 20180424)

I had this error when I tried to install a python version with pyenv on MacOs big sur.

By running this command it worked for me!

CFLAGS=-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include LDFLAGS=-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib \ pyenv install --patch 3.8.0 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1)

Now when I run pyenv versions I have the python versions

Other errors when installing Capybara Webkit Gem - M1 Mac Big Sur

Well, it turns out that installing capybara-webkit gem can give you different problems, in my case I had to install

capybara-webkit -v '1.15.1'.

You need to install QT as a dependecy.

The latest versions of QT including 5.6 returns the following message:

QtWebKit is no longer included with Qt 5.6

I followed one of our guides here, however it appears that QT version 5.5 was removed.

cd $( brew --prefix )/Homebrew/Library/Taps/homebrew/homebrew-core
git checkout 9ba3d6ef8891e5c15dbdc9333f857b13711d4e97 Formula/qt@5.5.rb
brew install qt@5.5

curl: (22) The requested URL returned error: 404
Error: Failed to download resource "qt@5.5_bottle_manifest"
Download failed: https://ghcr.io/v2/homebrew/core/qt/5.5/manifests/5.5.1_1

I also tried through binary installer but I got the following error:

Error creating SSL context

I finally succeeded, installing an older version

brew tap cartr/qt4
brew install qt@4
brew install qt-webkit@2.3
gem install capybara-webkit -v '1.15.1'

Building native extensions. This could take a while...
Successfully installed capybara-webkit-1.15.1
1 gem installed

Fixing the Capybara Webkit Gem installation - QtWebKit is no longer included with Qt 5.6 error on M1 Mac with Big Sur

If you installed any version above 5.6 make sure you uninstall all those versions, for instance:

MacBook-Air:myproject heridev$ brew uninstall qt
Uninstalling /usr/local/Cellar/qt/6.0.3_2... (8,233 files, 158.7MB)
MacBook-Air:myproject heridev$ brew uninstall qt@5
Uninstalling /usr/local/Cellar/qt@5/5.15.2... (10,688 files, 367.9MB)

Then we need to install the 5.5 version (old version):

cd $( brew --prefix )/Homebrew/Library/Taps/homebrew/homebrew-core
git checkout 9ba3d6ef8891e5c15dbdc9333f857b13711d4e97 Formula/qt@5.5.rb
// this will install the qt from shopify/shopify
brew install qt@5.5

And make sure you add the qt PATH in my case:

echo 'export PATH="/usr/local/opt/qt@5.5/bin:$PATH"' >> /Users/heridev/.bash_profile
source ~/.bash_profile

Now, you should be able to install the capybara webkit gem without any problems

Heroku console (IRB) with no "multiline"

If you need to paste a script in the Heroku console (IRB) with multiple lines and you notice it's very slow to finish pasting all the code, you can use the --nomultiline tag to disable multiline and let you run your script faster

heroku run 'bundle exec rails c -- --nomultiline'

Editing a file using cat

If you have to modify a file because any editor is present (vi, vim, nano, etc). you can use cat to do it:

$ cat > filename.ext
write or paste the content

ctrl+d

And that would be it! Super helpful when debugging flaky tests that only fail in the CI server

So you CAN disable swipe navigation in Chrome

Damn, I can't believe that I didn't think of disabling this dubious feature sooner. Can't even begin to tell you how often an errant fingertip brush makes my Chrome history go backwards (or forwards, for that matter). Turn that shit off with the following command in your terminal.

defaults write com.google.Chrome AppleEnableMouseSwipeNavigateWithScrolls -bool NO

Make sure to restart Chrome for it to take effect.

Exec a Login Shell

While setting up the Droplet that's hosting this site, I had to switch from root to the rails user several times. In order to get gems and bundler to work properly, I needed a login shell, which you don't get automatically just using su. The solution is to exec bash -l after su.

What I didn't already know is exactly why that command does what it does. Turns out that exec replaces the current process (my shell) instead of starting a new sub-process. So while just typing bash -l will also give you the intended result, it's not as efficient.