LoginSignup
0
1

More than 1 year has passed since last update.

【ruby】win10での環境構築【rails】

Posted at

ruby on railsの環境構築

この記事を書いた理由

AWSのcloud9から、自分のパソコンへ環境を移行しようと思ったのがきっかけ。
インスタンス起動してるとその分、お金がかかるので。

その過程をお届けします。

git からクローンしたアプリを
rails sしても、webpackerのエラーで悩まされた。
一日中、GPT先生にエラー内容を片っ端から解説してもらっていた。

もちろん、

bundle install
rails db:migrate
yarn install
rails webpacker:install

など、一通りコマンドをうちましたよ。

原因はnode.jsのバージョンが18だったことが原因でした。
結論から言うと、16系のバージョンが必要だった。

rails new して作成したアプリも、エラーが出てくる。
gemファイルの、

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

でエラーを起こしていた。いろいろ記事を調べたら、

, platforms: [:mingw, :mswin, :x64_mingw, :jruby]

この部分を消せばエラー解消できるようだったので、消したら、確かにエラーは解消された。

progateの手順で実行

ruby version 3

railsの環境構築

rails vesion 6

sqlite3

以下のコマンドをcmdに入力。

gem install sqlite3

上のリンクから、以下の2つをダウンロード

無題sql.png

展開(解凍)する

「sqlite3.dll」をRubyをインストールしたディレクトリの「bin」ディレクトリに移動する。

すべてのファイル「.exe」3つをRubyをインストールしたディレクトリの「bin」ディレクトリに移動する。
無題db.png

node.js

無題.png

node -v
versionが16系ならOK

yarn

Download the installer からmsiをダウンロードしてインストール。

yarn -v
1.22(現在のバージョン)

サーバーを立てる

rails s

参考にした記事

0
1
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
1