From a35adde8a98c481ec642f0a28dbfa3f684179ab4 Mon Sep 17 00:00:00 2001 From: hachi8833 Date: Mon, 23 Dec 2024 09:33:26 +0900 Subject: [PATCH 1/4] =?UTF-8?q?install=5Fruby=5Fon=5Frails.md=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- guides/source/ja/documents.yaml | 6 +- guides/source/ja/install_ruby_on_rails.md | 131 ++++++++++++++++++++++ 2 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 guides/source/ja/install_ruby_on_rails.md diff --git a/guides/source/ja/documents.yaml b/guides/source/ja/documents.yaml index 0f5989d289..45e43c65e5 100644 --- a/guides/source/ja/documents.yaml +++ b/guides/source/ja/documents.yaml @@ -7,9 +7,9 @@ url: getting_started.html description: Railsのインストール方法と最初のRailsアプリケーションの作成に必要なすべてを解説します。 - - name: Dev Containerでの開発ガイド - url: getting_started_with_devcontainer.html - description: VS CodeとDev Containerを使ってRailsアプリケーションの開発を行う方法について解説します。 + name: Ruby on Rails インストールガイド + url: install_ruby_on_rails.html + description: Rubyプログラミング言語とRuby on Railsのインストール方法について解説します。 - name: モデル documents: diff --git a/guides/source/ja/install_ruby_on_rails.md b/guides/source/ja/install_ruby_on_rails.md new file mode 100644 index 0000000000..d72f69e1ab --- /dev/null +++ b/guides/source/ja/install_ruby_on_rails.md @@ -0,0 +1,131 @@ +Install Ruby on Rails Guide +=========================== + +This guide will walk you through installing the Ruby programming language and the Rails framework on your operating system. + +While your OS might come with Ruby pre-installed, it's often outdated and can't be upgraded. Using a version manager like [Mise](https://mise.jdx.dev/getting-started.html) allows you to install the latest Ruby version, use a different Ruby version for each app, and easily upgrade to new versions when they're released. + +Alternatively, you can use Dev Containers to run Rails without installing Ruby or Rails directly on your machine. Check out the [Getting Started with Dev Containers](getting_started_with_devcontainer.html) guide to learn more. + +-------------------------------------------------------------------------------- + +## Choose Your Operating System + +Follow the section for the operating system you use: + +* [macOS](#install-ruby-on-macos) +* [Ubuntu](#install-ruby-on-ubuntu) +* [Windows](#install-ruby-on-windows) + +TIP: Any commands prefaced with a dollar sign `$` should be run in the terminal. + +### Install Ruby on macOS + +You'll need macOS Catalina 10.15 or newer to follow these instructions. + +For macOS, you'll need Xcode Command Line Tools and Homebrew to install dependencies needed to compile Ruby. + +Open Terminal and run the following commands: + +```shell +# Install Xcode Command Line Tools +$ xcode-select --install + +# Install Homebrew and dependencies +$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +$ echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc +$ source ~/.zshrc +$ brew install openssl@3 libyaml gmp rust + +# Install Mise version manager +$ curl https://mise.run | sh +$ echo 'eval "$(~/.local/bin/mise activate)"' >> ~/.zshrc +$ source ~/.zshrc + +# Install Ruby globally with Mise +$ mise use -g ruby@3 +``` + +### Install Ruby on Ubuntu + +You'll need Ubuntu Jammy 22.04 or newer to follow these instructions. + +Open Terminal and run the following commands: + +```bash +# Install dependencies with apt +$ sudo apt update +$ sudo apt install build-essential rustc libssl-dev libyaml-dev zlib1g-dev libgmp-dev + +# Install Mise version manager +$ curl https://mise.run | sh +$ echo 'eval "$(~/.local/bin/mise activate)"' >> ~/.bashrc +$ source ~/.bashrc + +# Install Ruby globally with Mise +$ mise use -g ruby@3 +``` + +### Install Ruby on Windows + +The Windows Subsystem for Linux (WSL) will provide the best experience for Ruby on Rails development on Windows. It runs Ubuntu inside of Windows which allows you to work in an environment that is close to what your servers will run in production. + +You will need Windows 11 or Windows 10 version 2004 and higher (Build 19041 and higher). + +Open PowerShell or Windows Command Prompt and run: + +```bash +$ wsl --install --distribution Ubuntu-24.04 +``` + +You may need to reboot during the installation process. + +Once installed, you can open Ubuntu from the Start menu. Enter a username and password for your Ubuntu user when prompted. + +Then run the following commands: + +```bash +# Install dependencies with apt +$ sudo apt update +$ sudo apt install build-essential rustc libssl-dev libyaml-dev zlib1g-dev libgmp-dev + +# Install Mise version manager +$ curl https://mise.run | sh +$ echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc +$ source ~/.bashrc + +# Install Ruby globally with Mise +$ mise use -g ruby@3 +``` + +Verifying Your Ruby Install +--------------------------- + +Once Ruby is installed, you can verify it works by running: + +```bash +$ ruby --version +ruby 3.3.6 +``` + +Installing Rails +---------------- + +A "gem" in Ruby is a self-contained package of a library or Ruby program. We can use Ruby's `gem` command to install the latest version of Rails and its dependencies from [RubyGems.org](https://rubygems.org). + +Run the following command to install the latest Rails and make it available in your terminal: + +```bash +$ gem install rails +``` + +To verify that Rails is installed correctly, run the following and you should see a version number printed out: + +```bash +$ rails --version +Rails 8.0.0 +``` + +NOTE: If the `rails` command is not found, try restarting your terminal. + +You're ready to [Get Started with Rails](getting_started.html)! \ No newline at end of file From 162e114f31e66d9b6319f71201ca24b6b7add58d Mon Sep 17 00:00:00 2001 From: hachi8833 Date: Thu, 26 Dec 2024 15:22:51 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[8.0.1]=20install=5Fruby=5Fon=5Frails.md?= =?UTF-8?q?=E3=82=92=E6=96=B0=E8=A6=8F=E7=BF=BB=E8=A8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- guides/source/ja/documents.yaml | 4 ++ guides/source/ja/install_ruby_on_rails.md | 82 ++++++++++++----------- 2 files changed, 46 insertions(+), 40 deletions(-) diff --git a/guides/source/ja/documents.yaml b/guides/source/ja/documents.yaml index 45e43c65e5..61cfa4536a 100644 --- a/guides/source/ja/documents.yaml +++ b/guides/source/ja/documents.yaml @@ -10,6 +10,10 @@ name: Ruby on Rails インストールガイド url: install_ruby_on_rails.html description: Rubyプログラミング言語とRuby on Railsのインストール方法について解説します。 + - + name: Dev Containerでの開発ガイド + url: getting_started_with_devcontainer.html + description: VS CodeとDev Containerを使ってRailsアプリケーションの開発を行う方法について解説します。 - name: モデル documents: diff --git a/guides/source/ja/install_ruby_on_rails.md b/guides/source/ja/install_ruby_on_rails.md index d72f69e1ab..30ed8a3032 100644 --- a/guides/source/ja/install_ruby_on_rails.md +++ b/guides/source/ja/install_ruby_on_rails.md @@ -1,131 +1,133 @@ -Install Ruby on Rails Guide +Ruby on Rails インストールガイド =========================== -This guide will walk you through installing the Ruby programming language and the Rails framework on your operating system. +本ガイドでは、Rubyプログラミング言語とRailsフレームワークをOS(オペレーティングシステム)にインストールする手順を説明します。 -While your OS might come with Ruby pre-installed, it's often outdated and can't be upgraded. Using a version manager like [Mise](https://mise.jdx.dev/getting-started.html) allows you to install the latest Ruby version, use a different Ruby version for each app, and easily upgrade to new versions when they're released. +OSにはRubyがプリインストールされている場合もありますが、最新でないことが多いうえに、アップグレードできないようになっています。[Mise](https://mise.jdx.dev/getting-started.html)などのバージョン管理ソフトウェアを使うことで、最新バージョンのRubyをインストールできるようになり、アプリごとに異なるバージョンのRubyを使い分けることも、新しいバージョンがリリースされたときのアップグレードも手軽に行えるようになります。 -Alternatively, you can use Dev Containers to run Rails without installing Ruby or Rails directly on your machine. Check out the [Getting Started with Dev Containers](getting_started_with_devcontainer.html) guide to learn more. +自分のコンピュータにRubyやRailsを直接インストールする代わりに、Dev Container環境内でRailsを実行することも可能です。詳しくは[Dev Containerガイド](getting_started_with_devcontainer.html)を参照してください。 -------------------------------------------------------------------------------- -## Choose Your Operating System +## OSごとのRubyインストール方法 -Follow the section for the operating system you use: +今使っているOSに応じて、以下のセクションを参照してください。 -* [macOS](#install-ruby-on-macos) +* [macOS](#macosにrubyをインストールする) * [Ubuntu](#install-ruby-on-ubuntu) * [Windows](#install-ruby-on-windows) -TIP: Any commands prefaced with a dollar sign `$` should be run in the terminal. +TIP: `$`で始まるコマンドはターミナルで実行してください。 -### Install Ruby on macOS +TIP: 訳注: [Rails Girls インストール・レシピ](https://railsgirls.jp/install)にもRubyとRailsのインストール方法が記載されています。こちらではmacOS環境のRubyインストールに[rbenv](https://github.com/rbenv/rbenv)を使っています。 -You'll need macOS Catalina 10.15 or newer to follow these instructions. +### macOSにRubyをインストールする -For macOS, you'll need Xcode Command Line Tools and Homebrew to install dependencies needed to compile Ruby. +これらの手順を実行するには、macOS Catalina 10.15以降が必要です。 -Open Terminal and run the following commands: +macOSでRubyをコンパイルするために必要な依存関係をインストールするには、Xcode Command Line ToolsとHomebrewが必要です。 + +ターミナルを開き、次のコマンドを実行します。 ```shell -# Install Xcode Command Line Tools +# Xcode Command Line Toolsをインストールする $ xcode-select --install -# Install Homebrew and dependencies +# Homebrewと依存関係をインストールする $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" $ echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc $ source ~/.zshrc $ brew install openssl@3 libyaml gmp rust -# Install Mise version manager +# Miseバージョンマネージャをインストールする $ curl https://mise.run | sh $ echo 'eval "$(~/.local/bin/mise activate)"' >> ~/.zshrc $ source ~/.zshrc -# Install Ruby globally with Mise +# MiseでRubyをグローバルにインストールする $ mise use -g ruby@3 ``` -### Install Ruby on Ubuntu +### UbuntuにRubyをインストールする -You'll need Ubuntu Jammy 22.04 or newer to follow these instructions. +これらの手順を実行するには、Ubuntu Jammy 22.04以降が必要です。 -Open Terminal and run the following commands: +ターミナルを開き、次のコマンドを実行します。 ```bash -# Install dependencies with apt +# aptで依存関係をインストールする $ sudo apt update $ sudo apt install build-essential rustc libssl-dev libyaml-dev zlib1g-dev libgmp-dev -# Install Mise version manager +# Miseバージョンマネージャをインストールする $ curl https://mise.run | sh $ echo 'eval "$(~/.local/bin/mise activate)"' >> ~/.bashrc $ source ~/.bashrc -# Install Ruby globally with Mise +# MiseでRubyをグローバルにインストールする $ mise use -g ruby@3 ``` -### Install Ruby on Windows +### WindowsにRubyをインストールする -The Windows Subsystem for Linux (WSL) will provide the best experience for Ruby on Rails development on Windows. It runs Ubuntu inside of Windows which allows you to work in an environment that is close to what your servers will run in production. +Windows Subsystem for Linux(WSL)は、WindowsでのRuby on Rails開発に最適なエクスペリエンスを提供します。WSLではWindows内でUbuntuを実行するため、production(本番)環境でサーバーが実行される環境に近い環境で作業できます。 -You will need Windows 11 or Windows 10 version 2004 and higher (Build 19041 and higher). +Windows 11、またはWindows 10バージョン 2004 以降(ビルド 19041 以降)が必要です。 -Open PowerShell or Windows Command Prompt and run: +PowerShell(またはWindowsコマンドプロンプト)を開いて、以下を実行します。 ```bash $ wsl --install --distribution Ubuntu-24.04 ``` -You may need to reboot during the installation process. +インストールプロセス中に再起動を求められる場合があります。 -Once installed, you can open Ubuntu from the Start menu. Enter a username and password for your Ubuntu user when prompted. +インストールが終わると、スタートメニューからUbuntuを開けるようになります。プロンプトが表示されたら、Ubuntuユーザーのユーザー名とパスワードを入力します。 -Then run the following commands: +続いて、以下のコマンドを実行します。 ```bash -# Install dependencies with apt +# aptで依存関係をインストールする $ sudo apt update $ sudo apt install build-essential rustc libssl-dev libyaml-dev zlib1g-dev libgmp-dev -# Install Mise version manager +# Miseバージョンマネージャをインストールする $ curl https://mise.run | sh $ echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc $ source ~/.bashrc -# Install Ruby globally with Mise +# MiseでRubyをグローバルにインストールする $ mise use -g ruby@3 ``` -Verifying Your Ruby Install +Rubyがインストールされたことを確認する --------------------------- -Once Ruby is installed, you can verify it works by running: +Rubyがインストールされたら、以下のコマンドを実行して動作を確認できます。 ```bash $ ruby --version ruby 3.3.6 ``` -Installing Rails +Railsをインストールする ---------------- -A "gem" in Ruby is a self-contained package of a library or Ruby program. We can use Ruby's `gem` command to install the latest version of Rails and its dependencies from [RubyGems.org](https://rubygems.org). +Rubyの「gem」とは、RubyのライブラリであるRubyプログラムの自己完結型パッケージです。Rubyの`gem`コマンドを使うことで、[RubyGems.org](https://rubygems.org)から最新バージョンのRailsと依存関係をインストールできます。 -Run the following command to install the latest Rails and make it available in your terminal: +以下のコマンドを実行して最新のRailsをインストールし、ターミナルで使えるようにします。 ```bash $ gem install rails ``` -To verify that Rails is installed correctly, run the following and you should see a version number printed out: +Railsが正しくインストールされていることを確認するには、以下のコマンドを実行するとバージョン番号が表示されます。 ```bash $ rails --version Rails 8.0.0 ``` -NOTE: If the `rails` command is not found, try restarting your terminal. +NOTE: `rails`コマンドが見つからない場合は、ターミナルを再起動してみてください。 -You're ready to [Get Started with Rails](getting_started.html)! \ No newline at end of file +以上で、RubyとRailsのインストールが完了します。[Railsをはじめよう](getting_started.html)ガイドに進みましょう! From c9f45e19a458f7322ba6b65e3438a3c4ca77e4cf Mon Sep 17 00:00:00 2001 From: hachi8833 Date: Thu, 26 Dec 2024 15:35:01 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=E5=86=85=E9=83=A8=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- guides/source/ja/install_ruby_on_rails.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guides/source/ja/install_ruby_on_rails.md b/guides/source/ja/install_ruby_on_rails.md index 30ed8a3032..e154066766 100644 --- a/guides/source/ja/install_ruby_on_rails.md +++ b/guides/source/ja/install_ruby_on_rails.md @@ -14,8 +14,8 @@ OSにはRubyがプリインストールされている場合もありますが 今使っているOSに応じて、以下のセクションを参照してください。 * [macOS](#macosにrubyをインストールする) -* [Ubuntu](#install-ruby-on-ubuntu) -* [Windows](#install-ruby-on-windows) +* [Ubuntu](#ubuntuにrubyをインストールする) +* [Windows](#windowsにrubyをインストールする) TIP: `$`で始まるコマンドはターミナルで実行してください。 From f0e8df10b765e2581c25e1adfd9b21283f6ae7fa Mon Sep 17 00:00:00 2001 From: hachi8833 Date: Tue, 31 Dec 2024 08:43:49 +0900 Subject: [PATCH 4/4] =?UTF-8?q?install=5Fruby=5Fon=5Frails.md=E3=81=AB?= =?UTF-8?q?=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- guides/source/ja/install_ruby_on_rails.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/ja/install_ruby_on_rails.md b/guides/source/ja/install_ruby_on_rails.md index e154066766..4573d98e83 100644 --- a/guides/source/ja/install_ruby_on_rails.md +++ b/guides/source/ja/install_ruby_on_rails.md @@ -5,7 +5,7 @@ Ruby on Rails インストールガイド OSにはRubyがプリインストールされている場合もありますが、最新でないことが多いうえに、アップグレードできないようになっています。[Mise](https://mise.jdx.dev/getting-started.html)などのバージョン管理ソフトウェアを使うことで、最新バージョンのRubyをインストールできるようになり、アプリごとに異なるバージョンのRubyを使い分けることも、新しいバージョンがリリースされたときのアップグレードも手軽に行えるようになります。 -自分のコンピュータにRubyやRailsを直接インストールする代わりに、Dev Container環境内でRailsを実行することも可能です。詳しくは[Dev Containerガイド](getting_started_with_devcontainer.html)を参照してください。 +Dockerが使える環境であれば、自分のコンピュータにRubyやRailsを直接インストールする代わりに、Dev Container環境内でRailsを実行することも可能です。詳しくは[Dev Containerガイド](getting_started_with_devcontainer.html)を参照してください。 --------------------------------------------------------------------------------