Homebrew12 月 1 更新了一个 2.6.0 好像专门针对 M1 的,
是我的问题,我安装 Homebrew 的时候没把目录放到 opt/Homebrew,导致他无论怎么跑都不是 arm
arch -x86_64 brew install postgresql 的时候会报这个错误: Warning: You are using macOS 11.0. We do not provide support for this released but not yet supported version. You will encounter build failures with some formulae. Please create pull requests instead of asking for help on Homebrew's GitHub, Twitter or any other official channels. You are responsible for resolving any issues you experience while you are running this released but not yet supported version.
Error: postgresql dependencies not built for the x86_64 CPU architecture: pkg-config was built for arm64 [email protected] was built for arm64 readline was built for arm64
我用的是 rbenv 版本管理工具安装的 ruby2.6.5,然后再命令前面添加 arch -x86_64 这种好像是属于通过 Rosetta 转编译的!
这样??arch -x86_64 brew install pg???
你好!我想请问一下我在 M1 上安装不上 pq (gem install pg -v '1.1.4' --source 'https://rubygems.org/') 一直报这些: Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/pg-1.1.4/ext /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20201203-96144-15ovz55.rb extconf.rb /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin20/rbconfig.rb:229: warning: Insecure world writable dir /usr/local/Cellar in PATH, mode 040777 checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header *** 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.
Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME) --with-pg --without-pg --enable-windows-cross --disable-windows-cross --with-pg-config --without-pg-config --with-pg_config --without-pg_config --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/pg-1.1.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/pg-1.1.4 for inspection. Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/pg-1.1.4/gem_make.out