kothru / TIL

Today I Learned
1 stars 0 forks source link

2019/05/13 Windows10+WSL(Ubuntu)+Rails 環境構築完全版 #7

Open kothru opened 5 years ago

kothru commented 5 years ago

開発者モードを有効にする https://www.ipentec.com/document/windows-windows-10-set-developer-mode

WSL有効化 https://qiita.com/Aruneko/items/c79810b0b015bebf30bb

sudo apt-get update sudo apt-get upgrade

sudo apt-get install build-essential libssl-dev libreadline-dev zlib1g-dev git

git clone https://github.com/rbenv/rbenv.git ~/.rbenv cd ~/.rbenv && src/configure && make -C src echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc exec $SHELL -l

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc exec $SHELL -l

rbenv install 2.6.3 rbenv global 2.6.3

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - sudo apt-get install -y nodejs

sudo gem install bundler

sudo npm install -g yarn

sudo apt-get install libsqlite3-dev

cd

git clone https://github.com/pserleung119/calendar.git cd calendar bundle install --path vendor/bundle

sudo yarn install --check-files

bundle exec rails s

kothru commented 5 years ago

https://qiita.com/fkshom/items/53de3a9b9278cd524099

sudo sed -i.bak -e "s%http://archive.ubuntu.com/ubuntu/%http://linux.yz.yamagata-u.ac.jp/ubuntu/%g" /etc/apt/sources.list

https://qiita.com/iganari/items/587c330a62e52023679d

sudo su -

apt update apt upgrade -y apt autoremove -y

rm -rfv /etc/localtime &&\ ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

echo 'LANG="en_US.UTF-8"' > /etc/default/locale

ls -la /usr/bin/editor ls -la /etc/alternatives/editor apt list --installed | grep vim update-alternatives --config editor 3 ls -la /etc/alternatives/editor

http://kk6.hateblo.jp/entry/20120425/1335363377 ~/.profile見たら.bashrc読んでるし.bashrcでおk

http://neos21.hatenablog.com/entry/2018/09/03/080000 nodebrewおk?

curl -L git.io/nodebrew | perl - setup echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bashrc source ~/.bashrc

nodebrew ls-remote nodebrew install v10.16.0 nodebrew use v10.16.0 node -v

https://qiita.com/msakamoto_sf/items/a1ae46979a42d6948ebd

一人なら--saveだけでよい

https://expressjs.com/ja/

mkdir myapp cd myapp npm init npm install express --save

npm install express-generator --save npx express -h npx express --view=pug myapp2 cd myapp2 npm install DEBUG=myapp:* npm start

node app.js

kothru commented 5 years ago

git config --global user.name "ユーザー名" git config --global user.email "メールアドレス"

kothru commented 5 years ago

https://qiita.com/youcune/items/222777415f00d19cccb4

kothru commented 5 years ago

2回目以降 mkdir blog && cd blog bundle init vi Gemfile bundle install --path=vendor/bundle -j4 bundle exec rails new .

kothru commented 4 years ago

以下で --path不要に bundle config set path 'vendor/bundle'