LoginSignup
4
6

More than 5 years have passed since last update.

Railsのプロジェクトに途中から参加するときの手順と躓くポイント(書き途中)

Last updated at Posted at 2018-02-12

まずはGithubからリポジトリをクローン

GithubにあるクローンURLを使って以下のコマンドを実行する

$ git clone https://github.com/xxx/yyy.git

※非公開リポジトリの場合は先にGithubに招待しておいてもらう

次にRubyのバージョンを合わせる

1. 使っているバージョンのrubyをrbenvでインストール

使っているrubyのバージョンを聞いて
そのバージョンのrubyがすでにパソコンに入っているかを確認

$ rbenv versions
  2.2.3
* 2.4.2
  2.5.0

入ってなかった場合インストールをする

rbenv install 2.3.0

2. localのディレクトリのデフォルトのバージョンに設定する

rbenv local 2.3.0

bundlerをインストールしGemをインストール

gem install bundler
bundle install

ここでエラーが出た。

An error occurred while installing rmagick (2.16.0), and Bundler cannot
continue.
Make sure that `gem install rmagick -v '2.16.0'` succeeds before bundling.

rmagickをインストールするためにはImageMagicとpkg-configが必要
version7以上だと対応していないので6以下を入れる

すでにImageMagickが入っている人は一度アンインストールする

brew uninstall imagemagick

その後ImageMagicのver6台をインストールし、pkg-configをインストールするために

brew install imagemagick@6
brew install pkg-config

その後パスを通すために

export PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig

最後にようやくお目当のrmagickをインストール

gem install rmagick

ちなみにこちらの記事もとても参考になった
https://qiita.com/fyhcu/items/8aa117bfef4279100fce

rails用のDataBaseを作って統合する

rake db:create
rake db:migrate

ここで再び問題が。

データベースを作るときにmysqlのパスワードを求められたがパスワードを忘れた。

対策

1.まずmysqlのサーバーを止める
※私の場合はmacの設定からmysqlの設定にとべ、そこでサーバーを止められた
2.mysqlにセーフモードで入る

mysqld_safe --skip-grant-tables &

3.mysqlの中で

mysql -u root
use mysql;
update user set authentication_string=password("password") where user='root';
flush privileges;
quit

を実行してrootのパスワードを変更する

参考

全体の筋道

RMagickインストール関係

https://www.google.co.jp/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwiS_Lbj06DZAhUQQLwKHQT1A0IQFggnMAA&url=https%3A%2F%2Fqiita.com%2Fniwasawa%2Fitems%2F1144f20a9f2de4b76977&usg=AOvVaw0v8_VVC8auHiAx9u6TDrwu
https://qiita.com/h-sakano/items/532aabbbddab84f58307

mysql関係

https://qiita.com/y1row/items/994ecf8b478b7aac4c7d
https://liginc.co.jp/web/programming/mysql/87393
https://qiita.com/ahaha0807_alg/items/7323a5d2dd365308cb94

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