drb requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210.

本文讲述了在安装CocoaPods过程中遇到的关于Ruby版本不满足要求的问题,解决方法包括升级DRB至2.0.6,安装ActiveSupport后,再重新安装CocoaPods到指定路径。

今天安装cocoa pod ,执行命令

sudo gem install -n /usr/local/bin cocoapods

遇到一个报错,
错误是这样的

	drb requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210.

解决方法
执行下面的命令

sudo gem install drb -v 2.0.6

然后再执行以下命令

sudo gem install activesupport -v 6.1.7.7

最后再次执行

sudo gem install -n /usr/local/bin cocoapods

就可以了

class Application(tk.Tk): def __init__(self): super().__init__() self.title("DRB状态批量更新工具") self.geometry("600x400") # 初始化日志队列和进度队列 self.log_queue = queue.Queue() self.progress_queue = queue.Queue() self._create_widgets() self._setup_logging() self.after(100, self.process_queues) def _create_widgets(self): # 输入区域 input_frame = ttk.Frame(self) input_frame.pack(pady=10, fill='x') ttk.Label(input_frame, text="DRB_ID列表(英文逗号分隔):").pack(side='left') self.id_entry = ttk.Entry(input_frame, width=50) self.id_entry.pack(side='left', padx=10) # 按钮区域 btn_frame = ttk.Frame(self) btn_frame.pack(pady=5) self.start_btn = ttk.Button( btn_frame, text="开始更新", command=self.start_update ) self.start_btn.pack(side='left') # 进度条 self.progress = ttk.Progressbar( self, orient='horizontal', length=400, mode='determinate' ) self.progress.pack(pady=10) # 日志区域 log_frame = ttk.Frame(self) log_frame.pack(fill='both', expand=True) self.log_text = tk.Text(log_frame, wrap='word') scrollbar = ttk.Scrollbar(log_frame, command=self.log_text.yview) self.log_text.configure(yscrollcommand=scrollbar.set) self.log_text.pack(side='left', fill='both', expand=True) scrollbar.pack(side='right', fill='y') def _setup_logging(self): logging.basicConfig( filename='update.log', level=logging.INFO, format='%(asctime)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S', encoding='utf-8' ) def start_update(self): self.start_btn.config(state='disabled') ids = self.id_entry.get().strip().split(',') ids = [did.strip() for did in ids if did.strip()] if not ids: self.log_text.insert('end', "请输入有效的DRB_ID!\n") self.start_btn.config(state='normal') return # 启动后台线程 updater = DBUpdater(self.log_queue, self.progress_queue) thread = Thread( target=updater.batch_update, args=(ids,), daemon=True ) thread.start() def process_queues(self): # 处理日志队列 while not self.log_queue.empty(): msg = self.log_queue.get() self.log_text.insert('end', f"{msg}\n") self.log_text.see('end') logging.info(msg) # 处理进度队列 while not self.progress_queue.empty(): current, total = self.progress_queue.get() self.progress['value'] = (current / total) * 100 self.update_idletasks() self.after(100, self.process_queues) if not any((thread.is_alive() for thread in threading.enumerate() if thread != threading.main_thread())): self.start_btn.config(state='normal') 逐行解释
03-24
评论 4
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值