分类 问题记录 下的文章

今天将系统升级至Ventura后发现Flutter iOS项目上跑不起来,报一下错误

Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5

查资料说要卸载重新安装Cocoapods

sudo gem install cocoapods

然后又得到了以下错误:

You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 directory.

又是谷歌一顿折腾后发现似乎是系统自带Ruby版本过旧的问题,使用Homebrew安装新版本的Ruby即可解决。

1、安装Ruby

brew install ruby

2、查看ruby版本

ruby -v

3、安装完成后发现依旧是2.6版本,需要设置环境变量

vim ~/.zshrc

ARM机型粘贴以下代码:

if [ -d "/opt/homebrew/opt/ruby/bin" ]; then
  export PATH=/opt/homebrew/opt/ruby/bin:$PATH
  export PATH=`gem environment gemdir`/bin:$PATH
fi

x86机型粘贴以下代码:


if [ -d "/usr/local/opt/ruby/bin" ]; then
  export PATH=/usr/local/opt/ruby/bin:$PATH
  export PATH=`gem environment gemdir`/bin:$PATH
fi

4、再次查看版本是否为安装的新版本

source ~/.zshrc
ruby -v
  1. 重新安装Cocoapods
sudo gem install cocoapods

然后进入运行flutter doctor,若没有错误项目应该就能跑起来了。

  1. 如果pod install出现权限问题
warning: Insecure world writable dir /opt/homebrew/bin in PATH, mode 040777

设置目录权限即可

sudo chmod -R go-w /opt/homebrew/bin
sudo chmod -R go-w /opt/homebrew

参考:
https://mac.install.guide/ruby/13.html
https://blog.csdn.net/liuwenchang1234/article/details/127635234

1、确保log_bin已开启

show variables like '%log_bin%';

2、查看bin_log文件目录

show variables like '%datadir%';

QQ截图20210716101452.png

3、进入bin_log文件目录,找到日志文件,文件名为mysql-bin.000xxx

cd /www/server/data/
ll

QQ截图20210716102437.png

4、复制mysql-bin文件,防止后续操作对其造成影响
5、使用mysqlbinlog(在mysql/bin目录中)工具,将日志导出sql

mysqlbinlog -d [database] mysql-bin.000006 > 006bin.sql

6、编辑导出的sql文件,将误删除语句剔除
7、执行sql文件

mysql -u root -p 123456 [database] < 006bin.sql 

搞定。

1、SignalR前端连接失败,出现以下错误

Failed to start the transport 'WebSockets': Error: There was an error with the transport.

问题:Nginx不支持WebSocket
解决方法:需要修改Nginx配置

location /hubroute {
  # Configuration for WebSockets
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection $connection_upgrade;
  proxy_cache off;
  # WebSockets were implemented after http/1.0
  proxy_http_version 1.1;
}

文档:https://docs.microsoft.com/zh-cn/aspnet/core/signalr/scale?view=aspnetcore-5.0#linux-with-nginx

2、HttpClient https请求出现证书问题

The SSL connection could not be established, see inner exception. The remote certificate is invalid according to the validation procedure.

解决方法:将系统证书复制到OpenSSL目录中

cp /etc/pki/tls/cert.pem /usr/local/openssl/