How do I stop iTerm2 from running xcodebuild and hanging when I open a window? - xcodebuild

Since this morning, on my iMac (macOS High Sierra Version 10.13.6) any time I open an iTerm2 window (with Oh My Zsh installed), I see this:
It seems that it's trying to run xcodebuild and it's stuck. I never get a prompt, even after waiting a long time. I've tried pressing ctrl+C to end the process, and then I see this:
I'm not purposely trying to do anything with Xcode. I just want to use the command line. I've been working for months without this problem, and it just started today. Any suggestion for how I can resolve this and use iTerm like normal?

I had the similar issue.
This resolved the problem:
# sudo xcodebuild -license accept

I got the same issue with macOS Big Sur.
Tried all Google results and nothing works. Eventually, I found it was caused by setting Node.js v8.x as default in nvm, alias default to system will resolve the issue. Although I don't know why nvm need to run xcodebuild for Node.js v8.x.

I have got the same issue after updating my MBP16 with Big Sur today
I have checked my xcode command tools path with xcode-select -p and I found that the path was related to an older version of xcode (10.1 in my case, I do not remember the path, maybe /Applications/Xcode_10.1.app/Contents/Developer/).
I have reinstall xcode command tools (sudo rm -rf /Library/Developer/CommandLineTools and xcode-select --install) and I have switched the xcode command tools path with this command sudo xcode-select -switch /Library/Developer/CommandLineTools
The issue is resolved now

Many answers but at the first start the console is still very slow (15s).
Looking around I found out that somehow nvm needs xcodebuild.
The slowdown was fixed changing the nvm default to system
nvm alias default system
Still not well clear why this is happening, I suggest to figure out trying to change the nvm configuration until you obtain the result.

The hanging I was experiencing happened only once after reboot, and consequent launches of the shell happened instantly.
I've spent hours debugging this issue. I eventually traced the hanging to homebrew's start script. My finding was that /usr/bin/git was slow at start (took 12 secs to load) for some reason and Homebrew used that binary unless another was installed. I installed a newer version of git through Homebrew using brew install git and this fixed the issue.
Investigation
I could see that the hang causes 100% CPU usage in syspolicyd and I could see a -67062 error at the end of the hang through Console.app (this error means code object is not signed at all). Unfortunately, the error log did not point me to a specific file and I had to add echos inside the brew script to isolate the exact location of the hang. It turned out to be an execution of git. Installing another version of git that would overwrite the default one fixed the problem. I used brew install git since homebrew checks its own directory first for a git binary.
I am not exactly sure how/why the code signature of /usr/bin/git is broken. It wasn't broken when I first installed Homebrew. It was somehow corrupted later on.

Related

`-bash: rbenv: command not found` comes up every time I open a terminal on window. How do I fix this?

I have this bash: rbenv: command not found thing always coming up on my terminal whenever I open it and they appear four times as shown below.
I am using windows, please, how do I fix this? All solutions I have researched are tailored toward MacOs.
bash: rbenv: command not found
bash: rbenv: command not found
bash: rbenv: command not found
bash: rbenv: command not found
I am using windows, please, how do I fix this? All solutions I have researched are tailored toward MacOs.
The error is coming from bash, a Unix shell. It's unclear how that's running on Windows (perhaps Windows Subsystem for Linux?) but the MacOS (really Unix) instructions should work.
Presumably you installed rbenv in this Unix on Windows environment at some point and now it's gone. If you want it back, install it again.
If you want it gone, follow the uninstall instructions. rbenv will add a line rbenv init to your shell startup configuration files. In bash, look at your .bashrc and .bash_profile files in your home directory and remove anything to do with rbenv.
If you don't know how to use bash, see Introduction to Bash for more.

Direnv not allowing me to allow

I've installed direnv (v2.18.2) onto my Ubuntu 16.04 machine using:
sudo snap install direnv
as per the website, and added the line:
eval "$(direnv hook bash)"
to my ~/.bashrc file as per the instructions. When I navigate into the directory with my .envrc file, the following message shown:
direnv: error .envrc is blocked. Run `direnv allow` to approve its content.
Sweet. So I run direnv allow, and I'm immediately hit with exactly the same error. I've also tried using direnv allow . but that doesn't seem to help. Also, completely restarting my laptop hasn't helped either.
All the advice I've seen is for direnv not finding the .envrc file, but here it is finding it, it's just not allowing me to allow it.
I know this is not a propper solution, but I encountered this aftering installing from a snap on Linux Mint.
After I uninstalled the snap and installed it from aptitude I did not have any issues.
While the OP is on Ubuntu I ran into the same problem with the snap installed binary on CentOS 7.7.
I worked around the problem by installing a go binary and then building direnv from source: git clone https://github.com/direnv/direnv.git; cd direnv; make; make install which got me direnv 2.21.2 in /usr/local/bin

mix local.hex fails from SSL after updating Erlang

I was prompted to update Erlang on my machine and I did. Then when I restarted my server I was prompted to update using mix local.hex.
When i did this it gave me the following error.
mix local.hex --force didn't work either.
I eventually found out that I installed erlang originally without brew originally which is where the prompt came from. After I updated it, it caused an issue with mix local.hex.
I manually removed the folder /usr/local/lib/erlang and all erlang on my machine. I installed erlang using 'brew install erlang' and then ran 'brew link erlang'
This originally didn't work because I didn't have permission but then I ran the following to get permission.
sudo chown -R $(whoami) /usr/local/lib
After that 'brew link erlang' worked and I was able to run 'mix local.hex' like normal.

Cannot start Chromium

I am trying to start Chromium 49.0.2623.108 on Ubuntu 15.10 installed on my ODROID-XU4. It used to work all the time but from one day to the next Chromium will not start. When I try to run it via terminal I get:
~$ chromium-browser
[3813:3840:0101/015306:ERROR:cert_verify_proc_nss.cc(925)] CERT_PKIXVerifyCert for www.google.com failed err=-8181
[3813:3840:0101/015306:ERROR:cert_verify_proc_nss.cc(925)] CERT_PKIXVerifyCert for translate.googleapis.com failed err=-8181
[3813:3839:0101/015306:ERROR:cert_verify_proc_nss.cc(925)] CERT_PKIXVerifyCert for clients2.google.com failed err=-8181
Segmentation fault
odroid#odroid:~$ libGL error: unable to load driver: exynos_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: exynos
[3866:3866:0101/015307:ERROR:sandbox_linux.cc(334)] InitializeSandbox() called with multiple threads in process gpu-process
Any idea what I can do?
I have already tried reinstalling Chromium. That did not solve the issue.
Thanks in advance!
Ok, so it looks like rolling Chromium back to version 45.0.2454.101 works as a temporary solution (although it'd still be great if someone got the newest version to work). To do this, I had to go through the following steps:
Run sudo apt-get remove chromium-browser to remove the broken version of the package
Get the list of available package versions via sudo apt-cache showpkg chromium-browser (at the time of writing, there were two: 50.0.2661.102 (newest) and 45.0.2454.101)
Install the older version, like so: sudo apt-get install chromium-browser=45.0.2454.101-0ubuntu1.1201
(Optional) If you got a dependency error during the previous step, execute these two first: sudo apt-get remove chromium-codecs-ffmpeg-extra and sudo apt-get install chromium-codecs-ffmpeg-extra=45.0.2454.101-0ubuntu1.1201
Chromium should start up fine now
This worked for two of my Odroid XU4's running Ubuntu 15.10 and Chromium 50.0.2661.102 (before the downgrade).
EDIT: looks like this problem affects all ARM-based single board computers, rather than the Odroid XU4 in particular (although the reference to exynos_dri.so might make it look like an Odroid XU4 issue). See here for more information + other ways to rollback to an older version.
EDIT #2: There also seems to be a way to get the newest version to work, but I have not tried this out so I don't know whether it will actually work or not.

RubyODBC Cannot allocate SQLHENV

I'm trying to connect to SQL Server on Ubuntu 9.04 using Ruby. I translated and followed all the steps outlined in getting OSX talking to SQL Server from here:
http://toolmantim.com/articles/getting_rails_talking_to_sqlserver_on_osx_via_odbc
Everything is working on the FreeTDS and unixODBC end. I can see and query the database using tsql.
When I try to access the database from Ruby using IRB I get the following error:
DBI::DatabaseError : INTERN (0) [RubyODBC] Cannot allocate SQLHENV
Has anyone run into this and what can I do to solve this?
I started getting this error when I upgraded to Ubuntu 9.10 (Karmic Koala). Your tip regarding installation order of the Ubuntu packages didn't work for me.
It seems the fix was to manually compile ruby-odbc.
wget http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9997.tar.gz
tar xzvf ruby-odbc-0.9997.tar.gz
cd ruby-odbc-0.9997
ruby extconf.rb --with-dlopen
make
sudo make install
System
Ubuntu 9.10 64 bit
I had to specify the odbc directory in the rubyodbc install
wget http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9997.tar.gz
tar xzvf ruby-odbc-0.9997.tar.gz
cd ruby-odbc-0.9997
ruby extconf.rb --with-odbc-dir=/usr/lib/odbc --disable-dlopen
make
sudo make install
I had the same problem.
But on Centos 5.5 not Ubuntu
Tried many forums/solutions with no joy.
The error message hints at a missing reference to unixODBC.
Which was setting using LD_LIBRARY_PATH variable.
Found another way to set path, by creating
/etc/ld.so.conf.d/odbc.conf.
add unixODBC location to file ie /usr/local/lib.
Run, sudo ldconfig.
Go fig that I actually got this working after submitting my question. What I ended up doing was uninstall libdbd-odbc-ruby and libdbi-ruby and then reinstalling them by installing libdbi-ruby first and then installing libdbd-odbc-ruby. I guess when I installed them before, something must of messed up.
BTW, following the instructions to recompile Ruby-ODBC on Ubuntu 9.10 (Karmic) required installation of either the libiodbc2-dev or the unixodbc-dev package. When using libiodbc2-dev, I got segmentation faults when my Ruby program tried:
connection.select_all('select top 15 * from log_device_healths')
..but no problem when using unixodbc-dev instead.
Tim Morgan's solution didn't work for me. However I was able to get things working by installing an older version of libodbc-ruby (0.9995) from here:
http://mirrors.kernel.org/ubuntu/pool/universe/libo/libodbc-ruby/libodbc-ruby1.8_0.9995-1_i386.deb
Additional details are available from Carsten Gehling's blog:
http://gehling.dk/2010/02/the-woes-of-libodbc-ruby1-8-and-debian-ubuntu/
Be careful though -- Ubuntu's Update Manager will happily "upgrade" this version of libodbc-ruby to the broken 0.9997-2. I accidentally overwrote the older version this way only to end up back here, trying to figure out how I fixed it last time.
Well, it seems my other answer stopped working for me. This thread helped me to solve the issue in another way, and I wanted to share it here.
sudo gem uninstall ruby-odbc
sudo rm /usr/local/lib/site_ruby/1.8/x86_64-linux/odbc.so
cd /tmp
wget http://mirrors.kernel.org/ubuntu/pool/universe/libo/libodbc-ruby/libodbc-ruby1.8_0.9995-1_amd64.deb
sudo dpkg -i libodbc-ruby1.8_0.9995-1_amd64.deb
If you're not on a 64-bit platform, you'll need to download a different Debian package.
Basically, what solves the problem is installing version 0.9995 of the ruby-odbc Ubuntu package.