Git is not working after macOS update (“xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools”)

The problem is that Xcode Command-line Tools needs to be updated due to OS update. ** UPDATED for Ventura and updated apple dev download page ** After opening the terminal after a restart, I tried to go to my code, and do a git status, and I got an error and prompt for command line … Read more

OSX application without storyboard or xib files using Swift

if you don’t want to have the @NSApplicationMain attribute, do: have a file main.swift add following top-level code: import Cocoa let delegate = AppDelegate() //alloc main app’s delegate class NSApplication.shared.delegate = delegate //set as app’s delegate NSApplicationMain(CommandLine.argc, CommandLine.unsafeArgv) //start of run loop // Old versions: // NSApplicationMain(C_ARGC, C_ARGV) // NSApplicationMain(Process.argc, Process.unsafeArgv); the rest should be … Read more

Relative Paths Not Working in Xcode C++

Took me about 5 hours of Google and trying different things to FINALLY find the answer! #ifdef __APPLE__ #include “CoreFoundation/CoreFoundation.h” #endif // —————————————————————————- // This makes relative paths work in C++ in Xcode by changing directory to the Resources folder inside the .app bundle #ifdef __APPLE__ CFBundleRef mainBundle = CFBundleGetMainBundle(); CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle); char … Read more

Getting a “bad interpreter” error when using brew

I got this error (much the same): /usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory /usr/local/bin/brew: line 26: /usr/local/Library/brew.rb: Undefined error: 0 and fixed by the solution below: Open brew.rb: $ sudo vim /usr/local/Library/brew.rb Change the first line’s 1.8 to Current: Before: #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0 After: #!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0 Then brew works for me. Hope … Read more

How to use “RVM –default” on MacOSX

I had the same problem once. It turned out the rvm-script got loaded twice, which broke things a bit. Check all the files that load when you open a shell: /etc/profile ~/.bashrc ~/.bash_profile and so on, and make sure they don’t load RVM twice. Maybe put echo “Going to load RVM” before [[ -s “/Users/user/.rvm/scripts/rvm” … Read more

gdb 8.2 can’t recognized executable file on macOS Mojave 10.14

The problem is that clang-1000.11.45.2 distributed with Apple LLVM version 10.0.0 adds a new load command to o-mach executables named LC_BUILD_VERSION. $ otool -l test.o … Load command 1 cmd LC_BUILD_VERSION cmdsize 24 platform macos sdk n/a minos 10.14 ntools 0 … From the apple source: /* * The build_version_command contains the min OS version … Read more

How do you install lxml on OS X Leopard without using MacPorts or Fink?

Thanks to @jessenoller on Twitter I have an answer that fits my needs – you can compile lxml with static dependencies, hence avoiding messing with the libxml2 that ships with OS X. Here’s what worked for me: cd /tmp curl -O http://lxml.de/files/lxml-3.6.0.tgz tar -xzvf lxml-3.6.0.tgz cd lxml-3.6.0 python setup.py build –static-deps –libxml2-version=2.7.3 –libxslt-version=1.1.24 sudo python … Read more