docs: update zh-tw (#265)

Reviewed-on: https://gitea.com/gitea/docs/pulls/265
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: ifurther <55025025+ifurther@users.noreply.github.com>
Co-committed-by: ifurther <55025025+ifurther@users.noreply.github.com>
This commit is contained in:
ifurther
2025-09-03 21:00:35 +00:00
committed by techknowlogick
parent 908a27589d
commit cb462089e9
88 changed files with 3545 additions and 3423 deletions

View File

@@ -4,27 +4,27 @@ slug: "rubygems"
sidebar_position: 110
---
# RubyGems 软件包注册
# RubyGems 軟體包註冊
您的用户或组织发布 [RubyGems](https://guides.rubygems.org/) 软件包。
您的使用者或組織發佈 [RubyGems](https://guides.rubygems.org/) 軟體包。
## 要求
要使用RubyGems软件包注册表,您需要使用 [gem](https://guides.rubygems.org/command-reference/) 命令行工具来消费和发布软件包。
要使用RubyGems軟體包註冊表,您需要使用 [gem](https://guides.rubygems.org/command-reference/) 命令行工具来消费和發佈軟體包。
## 配置软件包注册
## 配置軟體包註冊
要注册软件包注册表,编辑 `~/.gem/credentials` 文件添加:
要注册軟體包註冊表,编辑 `~/.gem/credentials` 文件添加:
```ini
---
https://gitea.example.com/api/packages/{owner}/rubygems: Bearer {token}
```
| 参数 | 描述 |
| 參數 | 描述 |
| ------- | ------------------------------------------------------------------------------------- |
| `owner` | 软件包的所有者 |
| `token` | 您的[个人访问令牌](development/api-usage.md#通-api-认证) |
| `owner` | 軟體包的所有者 |
| `token` | 您的[个人访问令牌](development/api-usage.md#通-api-認證) |
例如:
@@ -33,18 +33,18 @@ https://gitea.example.com/api/packages/{owner}/rubygems: Bearer {token}
https://gitea.example.com/api/packages/testuser/rubygems: Bearer 3bd626f84b01cd26b873931eace1e430a5773cc4
```
## 发布软件
## 發佈軟體
运行以下命令来发布软件包:
运行以下命令来發佈軟體包:
```shell
gem push --host {host} {package_file}
```
| 参数 | 描述 |
| 參數 | 描述 |
| -------------- | ------------------------ |
| `host` | 软件包注册表的URL |
| `package_file` | 软件`.gem` 文件的路径 |
| `host` | 軟體包註冊表的URL |
| `package_file` | 軟體`.gem` 文件的路径 |
例如:
@@ -52,11 +52,11 @@ gem push --host {host} {package_file}
gem push --host https://gitea.example.com/api/packages/testuser/rubygems test_package-1.0.0.gem
```
如果已经存在相同名和版本的软件包,您将无法发布软件包。您必先删除有的软件包。
如果已经存在相同名和版本的軟體包,您将無法發佈軟體包。您必先删除有的軟體包。
## 安装软件
## 安裝軟體
要从软件包注册表安装软件包,您可以使用 [Bundler](https://bundler.io) 或 `gem`
要从軟體包註冊表安裝軟體包,您可以使用 [Bundler](https://bundler.io) 或 `gem`
### Bundler
@@ -68,10 +68,10 @@ source "https://gitea.example.com/api/packages/{owner}/rubygems" do
end
```
| 参数 | 描述 |
| 參數 | 描述 |
| -------------- | -------------- |
| `owner` | 软件包的所有者 |
| `package_name` | 软件包名 |
| `owner` | 軟體包的所有者 |
| `package_name` | 軟體包名 |
例如:
@@ -89,16 +89,16 @@ bundle install
### gem
行以下命令:
行以下命令:
```shell
gem install --host https://gitea.example.com/api/packages/{owner}/rubygems {package_name}
```
| 参数 | 描述 |
| 參數 | 描述 |
| -------------- | -------------- |
| `owner` | 软件包的所有者 |
| `package_name` | 软件包名 |
| `owner` | 軟體包的所有者 |
| `package_name` | 軟體包名 |
例如: