Skip to content

勤怠管理やタスク管理用アプリケーション[サーバ]

Notifications You must be signed in to change notification settings

RailsCorp/xtreme

Repository files navigation

README

This README would normally document whatever steps are necessary to get the application up and running.

Things you may want to cover:

  • Ruby version

Rails ver 5.2.0

ruby 2.5.1p57 (2018-03-29 revision 63029)

  • System dependencies

  • Configuration

    fatモデル、fatコントローラにならないことを気をつける

    基本的にControllerでの処理がfatになりやすいから、QueryやUsecaseを使う

  • Database creation

MySQL -> config/environment/development.log

socketの位置で環境変数を使う

  • Database initialization

  • How to run the test suite

  • Services (job queues, cache servers, search engines, etc.)

  • Deployment instructions

⭐️仮想環境を作る手順

  1. 以下のurlからVirtualBoxをインストール https://www.virtualbox.org/wiki/Download_Old_Builds_5_1 注意) 最新版はver5.2だけど、ver5.2は、まだrails使えないのでver5.1をインストール

  2. VirtualBox内にcentOSインストール ターミナルで、

vagrant box add centos/7

を打つ。 途中で、選択が来るからVirtualboxを選択。Successfulyみたいなのが出たら、OK

  1. mkdir vagrantでvagrantディレクトリを作成。

  2. cd vagrantでvagrantディレクトリ内に入り、vagrant init centos/7を実行(macOS上)。

  3. 4.が終了したらvagrantディレクトリ内にlsで、Vagrantfileができているか確認。

vagrant up

を実行。終了したら、

vagrant ssh

を実行し、vagrant内に入る。

このとき、

[vagrant@localhost@ ~]

になっていればOK

  1. cd /vagrantを実行し、pwdコマンドでちゃんと/vagrantになっていることを確認。

注) 必ず、異動先のコマンドで必ず/vagrantにしてください!

  1. Vagrantfileが存在するホストディレクトリ上(macOS側)と

    ゲストディレクトリ上(centOS側)の/vagrantが共有してます。

    確認) 確認として、ターミナルを二つ開き、vagrantとmacとで分けてmacOS側でtouch testでtestファイルを作ってみる。

    vagrant上でlstestファイルが存在すればOK

    できてなかったら、ゴウキにSlack投げて!

ここからは全てvagrantに入ってからの話。

  1. Gitインストール

yum -y install git

でGitをインストール

確認として

git --version

を実行!

もし入らなかったら、ググって解決してください!

  1. rbenvの導入

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

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile

echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

を順に実行。

rbenv --version

で入っているかを確認。

  1. ruby-buildの導入

git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

  1. rubyの導入

sudo yum -y install openssl-devel gcc readline-devel libffi-devel mysql-devel gcc-c++

を実行。

rbenv install 2.5.0

を実行し、

rbenv global 2.5.0

でglobalに設定。

ruby -v

でver2.5.0が入っているかを確認。

  1. railsの導入

gem install multi_json -v '1.10.1'

rbenv exec gem install bundler

rbenv rehash

gem install rails 終了。

あとは、 git config コマンドで、usernameとuser.emailを登録してくれれば、使えるようになるはず。

つまずいたら、Slack投げて!

pullしたらやったら必ずやること!

bundle install

bundle exec rails db:migrate

※ 必要に応じては、

bundle exec rails db:migrate:reset

About

勤怠管理やタスク管理用アプリケーション[サーバ]

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published