mirror of
https://gitea.com/gitea/docs.git
synced 2026-07-22 12:27:50 +00:00
Update zh tw languages and fix some broken links (#455)
--------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: silverwind <2021+silverwind@noreply.gitea.com> Reviewed-on: https://gitea.com/gitea/docs/pulls/455 Reviewed-by: silverwind <2021+silverwind@noreply.gitea.com>
This commit is contained in:
@@ -4,17 +4,17 @@ 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
|
||||
---
|
||||
@@ -23,8 +23,8 @@ 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,9 +33,9 @@ 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}
|
||||
@@ -43,8 +43,8 @@ gem push --host {host} {package_file}
|
||||
|
||||
| 參數 | 描述 |
|
||||
| -------------- | ------------------------ |
|
||||
| `host` | 軟體包註冊表的URL |
|
||||
| `package_file` | 軟體包 `.gem` 文件的路径 |
|
||||
| `host` | 套件註冊表的URL |
|
||||
| `package_file` | 套件 `.gem` 文件的路徑 |
|
||||
|
||||
例如:
|
||||
|
||||
@@ -52,15 +52,15 @@ 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
|
||||
|
||||
在您的 `Gemfile` 中添加一个新的 `source` 块:
|
||||
在您的 `Gemfile` 中添加一個新的 `source` 塊:
|
||||
|
||||
```
|
||||
source "https://gitea.example.com/api/packages/{owner}/rubygems" do
|
||||
@@ -70,8 +70,8 @@ end
|
||||
|
||||
| 參數 | 描述 |
|
||||
| -------------- | -------------- |
|
||||
| `owner` | 軟體包的所有者 |
|
||||
| `package_name` | 軟體包名稱 |
|
||||
| `owner` | 套件的所有者 |
|
||||
| `package_name` | 套件名稱 |
|
||||
|
||||
例如:
|
||||
|
||||
@@ -81,7 +81,7 @@ source "https://gitea.example.com/api/packages/testuser/rubygems" do
|
||||
end
|
||||
```
|
||||
|
||||
之后运行以下命令:
|
||||
之後運行以下命令:
|
||||
|
||||
```shell
|
||||
bundle install
|
||||
@@ -97,8 +97,8 @@ gem install --host https://gitea.example.com/api/packages/{owner}/rubygems {pack
|
||||
|
||||
| 參數 | 描述 |
|
||||
| -------------- | -------------- |
|
||||
| `owner` | 軟體包的所有者 |
|
||||
| `package_name` | 軟體包名稱 |
|
||||
| `owner` | 套件的所有者 |
|
||||
| `package_name` | 套件名稱 |
|
||||
|
||||
例如:
|
||||
|
||||
@@ -106,7 +106,7 @@ gem install --host https://gitea.example.com/api/packages/{owner}/rubygems {pack
|
||||
gem install --host https://gitea.example.com/api/packages/testuser/rubygems test_package
|
||||
```
|
||||
|
||||
## 支持的命令
|
||||
## 支援的命令
|
||||
|
||||
```
|
||||
gem install
|
||||
|
||||
Reference in New Issue
Block a user