LoginSignup
0
0

More than 1 year has passed since last update.

廃棄PCのantix上にrubyonrails環境構築テスト

Posted at

rubyonrails-test

  • 家の廃棄予定のノートPC(Pentium)にantixをいれて、rubyonrails+node.js環境構築のテスト
  • rubyは新しいものがいれられなかったため、2.6.3をビルドしている
  • 結論:nodeがうまくいれられずに断念

環境構築 mac

  • VSCode拡張

    • Ruby
    • HTML Snippets
  • Rubyのインストール

# update
brew update

# rbenv 
brew install rbenv ruby-build
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile

# readline
brew install readline
brew link readline --force

# ruby
RUBY_CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline)"
# install ruby
rbenv install 2.6.3
# use ruby
rbenv global 2.6.3
rbenv rehash
# check ruby version
ruby -v



環境構築 antiX

  • antiX install
  • 設定終わってログインしたらsudo apt update && sudo apt upgrade
  • grubの更新がされているので全てのディスクにインストールをする(BIOSありの場合)
  • 必要あればネットワークとかの設定を行うantiX-cli-cc

環境構築 antiX

  • rbenv ruby gem bundler

sudo apt update

sudo apt install -y gcc make bzip2 git libssl-dev libreadline-dev zlib1g-dev

sudo apt update

git clone https://github.com/rbenv/rbenv.git ~/.rbenv

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
# reload bash
source ~/.bashrc

mkdir -p "$(rbenv root)/plugins"
# rbenv プラグインをインストール
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)/plugins/ruby-build"
# rbenv install 後に ~/.rbenv/default-gems に記載の gem をインストールしてくれる
git clone https://github.com/rbenv/rbenv-default-gems.git "$(rbenv root)/plugins/rbenv-default-gems"
echo bundler > "$(rbenv root)/default-gems"
# $ rbenv update すると、~/.rbenv/plugins 以下を全部 git pull してくれる ruby-build も対象となる
git clone https://github.com/rkh/rbenv-update.git "$(rbenv root)/plugins/rbenv-update"

sudo apt update

rbenv install 2.6.3
rbenv global 2.6.3
rbenv rehash

# check version
ruby -v
gem -v
bundler -v

  • node.js npm
# get setup.sh
# execute setup.sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash

source ~/.profile

     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
     echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn


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