0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

rails-new のインストール方法

Last updated at Posted at 2025-04-02

1. rails-newコマンドとは

READMEには、

マシンに Ruby をインストールしなくても、新しい Rails アプリケーションを生成できます。

個人的には、Dev Container での開発をしてみたかったので、コマンド一つで Rails × Dev Container の環境が整うところに惹かれました。

詳しい導入方法はRailsガイドが分かりやすいと思います。

2. rails-newコマンド(v0.5.0)のインストール

① 以下のサイトからファイルをダウンロード
https://github.com/rails/rails-new/releases/tag/v0.5.0

M1 Mac の場合、
rails-new-aarch64-apple-darwin.tar.gz をダウンロード
もしくは自身のマシンにあったファイルをダウンロード

② 実行ファイルを作成
ファイルを解凍すると、以下のように rails-new が作成されます。
スクリーンショット 2025-03-31 21.27.25.png

③ 実行ファイルを /usr/local/bin へ移動
実行ファイルが置かれているフォルダへ移動し、以下のコマンドを実行

sudo mv rails-new /usr/local/bin/

④ 完了確認
以下のコマンドを実行し、

rails-new --help

以下のように出力されれば完了
スクリーンショット 2025-03-31 23.20.43.png

3. エラー対処

Macユーザガイドより
以下のようなエラーが出た場合、完了を押下し
スクリーンショット 2025-03-31 21.26.14.png

「システム設定」から「プライバシーとセキュリティ」を開き、「このまま開く」を押下
スクリーンショット 2025-03-31 21.40.58.png

さらにこのまま開くを押下
スクリーンショット 2025-03-31 21.43.42.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?