LoginSignup
2
4

More than 5 years have passed since last update.

Ubuntu16.04LTSでrails sするまで

Last updated at Posted at 2018-06-13

はじめに

古いPCを復活させた時のメモ
GitHubにリモートリポジトリがあるものとする

環境

Ubuntu 16.04 LTS 32bit
ruby 2.4.4
rails 5.1.6
DB
 develop:mysql 14.14
 product:postgresql

ネックになったもの

gem mysql2
gem pg
rails db:create

'bundle install' まで

・GitHubからクローンを持ってくる

git clone https://github.com/hoge/piyo.git
cd piyo
git init

・とりあえず

bundle install

結果

mysql client is missing. ~~~ 'apt-get install libmysqlclient-dev' or ~~~

とあるので

sudo apt install libmysqlclient-dev

※前までubuntuのパッケージインストールは'apt-get'だったが、
 いつの間にか'apt'推奨になったらしい

・気を取り直して

bundle install

結果

No pg_config... trying anyway. ~~~ please try again with --without ~~~

また怒られる。
ちなみに'--without'以降を付けても上手くいかない。
こちらを参考に

sudo apt install libpq-dev

これでbundle installが通る。

rails db:migrate

・やってみる

rails db:migrate

Could not find a Javascript runtime.

'Javascript runtime'が無いらしい。
調べたらnode.jsのこと?

sudo apt install nodejs

versionはとりあえず気にしない。

rails db:migrate

Unknown database 'mysql_development'

DBが無いらしいので作る。

rails db:create
rails db:migrate
rails s

終わり。

2
4
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
2
4