· 18天 ago
Aider 安装与配置步骤(针对本地 Ollama + 30B 模型,如 Qwen3-Coder-30B 或 Qwen2.5-Coder-32B,适用于你的中型 Ruby on Rails 项目,基于 2026 年 1 月最新官方文档):
curl -fsSL https://ollama.com/install.sh | sh
ollama serve
ollama pull qwen3-coder:30b或
ollama pull qwen2.5-coder:32b-instruct
OLLAMA_CONTEXT_LENGTH=16384 ollama serve # 或更高如 32768(新终端运行,或用 Modelfile 创建自定义模型:FROM qwen3-coder:30b \n PARAMETER num_ctx 16384,然后 ollama create myqwen -f Modelfile)
curl -LsSf https://aider.chat/install.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://aider.chat/install.ps1 | iex"
python -m pip install -U aider-chat
export OLLAMA_API_BASE=http://127.0.0.1:11434
setx OLLAMA_API_BASE http://127.0.0.1:11434(运行后重启终端)
ollama_chat/ 前缀(兼容性更好):aider --model ollama_chat/qwen3-coder:30b
cd /path/to/your/rails-project
aider --model ollama_chat/qwen3-coder:30b或指定上下文/其他选项(推荐中型项目):
aider --model ollama_chat/qwen3-coder:30b --4o --map-tokens 2048(--4o 用 Claude 风格提示,--map-tokens 控制 repo map 大小)
Add a new User model with devise authenticationFix the bug in app/controllers/posts_controller.rb where create action fails on validationRefactor the User model to follow Fat Model Skinny Controller, move logic from controller--no-stream 测试。一句话总结:安装 Ollama → 拉模型 → 增大上下文 → 一键装 Aider → aider --model ollama_chat/qwen3-coder:30b 启动,即可在你的 Rails 项目里像 Claude Code 一样本地 pair programming,无限用、隐私满分!
遇到问题?运行 aider --help 或 /help 在 Aider 里问。需要我帮你写 Modelfile 或具体 Rails 提示模板吗?
與您的關注者分享。
回覆