I’ve been having another go at repairing my dev setup for the project site so that I can do some tutorial updates. I find that each time I come back to it after a break of a few weeks, it is broken again. (Using Mac OS 10.13.6).
I think there might be a PATH
issue. If that is likely, scroll down to where I discuss this.
What happened just now:
On opening the command line (Terminal), the warning Required ruby-2.5.1 is not installed.
is shown. The installation guide on the project site repo states to use Ruby 2.3. Attempting to install 2.3 produced the following error at various stages in the process:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
and ended with
Error: Failure while executing; `git config --local --replace-all homebrew.analyticsmessage true` exited with 1.
Does that mean that XCode Command Line Tools needs to be reinstalled? Or do I need to (re)set a path for it?
I stuck with the installed Ruby 2.4.0, updated Bundler to 1.16.6 and then tried the next step, bundle install --with mysql
. First I got an advice alert, which would be nice to resolve for the future:
The git source `git://github.com/feedjira/feedjira.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
Bundling was fine with gems already up to date until it reached nokogiri:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/Users/[me]/.rvm/gems/ruby-2.4.0/gems/nokogiri-1.8.4/ext/nokogiri
/Users/[me]/.rvm/rubies/ruby-2.4.0/bin/ruby -r ./siteconf20181021-4414-b31nlj.rb
extconf.rb
checking if the C compiler accepts ... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
The full log, in /.rvm/gems/ruby-2.4.0/extensions/x86_64-darwin-16/2.4.0/nokogiri-1.8.4/mkmf.log
, reads:
"gcc -o conftest -I/Users/[me]/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/x86_64-darwin16 -I/Users/[me]/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/backward -I/Users/[me]/.rvm/rubies/ruby-2.4.0/include/ruby-2.4.0 -I. -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -L. -L/Users/[me]/.rvm/rubies/ruby-2.4.0/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl@1.1/lib -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl@1.1/lib -lruby.2.4.0 -lpthread -ldl -lobjc "
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
PATH issues?
I think that one reason for the repeated problems I have might be that PATH
is improperly set. I find, for instance, that duplicate gems appear in different folders (more for the main diaspora setup than for the project site). And I occasionally get warnings such as
> Warning! PATH is not properly set up, /Users/[me]/.rvm/gems/ruby-2.4.0/bin is not at first place.
I have the following possibly relevant files in my root user folder with contents as shown:
- .bash_profile
source ~/.profile
# Added by install_latest_perl_osx.pl
[ -r /Users/[me]/.bashrc ] && source /Users/[me]/.bashrc
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
- .barshrc
PATH=$PATH:/Users/[me]/.rvm/gems/ruby-2.3.3/bin
source /Users/[me]/perl5/perlbrew/etc/bashrc
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
- .profile
# MacPorts Installer addition on 2012-09-26_at_17:37:59: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export PATH=/usr/local/bin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
PATH=$PATH:$HOME/.rvm/gems/ruby-2.3.1/bin
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
- .mkshrc
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
- .zlogin
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
- .zshrc
PATH=$PATH:$HOME/.rvm/gems/ruby-2.3.1/bin
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
If there are some issues with the setup evident from those files, it might be easiest to uninstall everything and set the PATH
properly and start again. What would be the safest way to do this? I did try to do this for the main diaspora setup earlier this year, as far as uninstalling homebrew itself, and reinstalling everything, but that still didn’t produce a working installation. I fear there might be bits and pieces left over from an earlier installation that should have been removed during an update but weren’t because of the PATH
issue.
If you could advise on this issue first, or tell me what further info you need, that would be fantastic.