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?

More than 1 year has passed since last update.

Debian 12: Ruby on Rails を使う

Last updated at Posted at 2024-02-07

必要なソフトのインストール

sudo apt install ruby
sudo apt install ruby-dev
sudo apt install sqlite3
sudo apt install make
sudo apt install gcc
sudo apt install zlib1g-dev
sudo apt install git
sudo apt install libsqlite3-dev libssl-dev libreadline-dev libyaml-dev

Ruby のバージョン

$ ruby --version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-gnu]

Rails のインストール

sudo gem install rails

Rails のバージョン

$ rails --version
Rails 7.1.3

動作確認

プロジェクトの作成

rails new railsapp

サーバーの起動

cd railsapp
rails s -b 0.0.0.0
$ rails s -b 0.0.0.0
=> Booting Puma
=> Rails 7.1.3 application starting in development 
=> Run `bin/rails server --help` for more startup options
Puma starting in single mode...
* Puma version: 6.4.2 (ruby 3.1.2-p20) ("The Eagle of Durango")
*  Min threads: 5
*  Max threads: 5
*  Environment: development
*          PID: 6610
* Listening on http://0.0.0.0:3000
Use Ctrl-C to stop

ブラウザーで http://IPアドレス:3000 にアクセス

image.png

bundle install を使えるようにする

sudo gem install bundler
sudo gem install bundle
sudo gem install minitest
sudo gem install irb
sudo gem install turbo-rails
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?