LoginSignup
0
0

More than 3 years have passed since last update.

[Rails] cloneしたリポジトリをrailsサーバーで起動する

Posted at

git hubからcloneしたリポジトリをrailsサーバーで起動するまでの道のりを記録しました。

リポジトリをclone

$ git clone https://github.com/*****/*****.git

サーバー起動コマンドを打ってみる

$ bin/rails s

Could not find rake-13.0.1 in any of the sources
Run `bundle install` to install missing gems.

エラーが出て起動しません。bundleがないみたい。指定されたコマンドを打ってみます。

$ bundle install

/Users/*****/.anyenv/envs/rbenv/libexec/rbenv-exec: /usr/local/bin/bundle: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory
/Users/*****/.anyenv/envs/rbenv/libexec/rbenv-exec: line 47: /usr/local/bin/bundle: Undefined error: 0

これもまたエラーが出て失敗しています。

エラー解消の旅

teratailCould not find XXXX in any of the sources エラーの修正方法を参考にさせていただきました。

まずはどのruby, bundleを参照しているか確認。

$ which ruby

/Users/*****/.anyenv/envs/rbenv/shims/ruby

$ which bundle

/Users/*****/.anyenv/envs/rbenv/shims/bundle

.anyenvの中のrubyとbundleを見ているのでこれは大丈夫そう。

そして、bundlerをインストールする。
$ gem install bundler
You don't have write permissionsと言われたのでsudoをつけます。

$ sudo gem install bundler
途中2回PC起動時のパスワードの入力を求められますがbundlerのインストールに成功。

満を辞して$ bin/rails s

=> Booting Puma
=> Rails 6.0.2.2 application starting in development 
=> Run `rails server --help` for more startup options
error Couldn't find an integrity file                                          
error Found 1 errors.                                                          


========================================
  Your Yarn packages are out of date!
  Please run `yarn install --check-files` to update.
========================================
(以下省略)

yarnをinstallしてね、とのこと。コマンドまで教えてくれていたのに癖で--check-filesオプションを付けずに、$ yarn installをしてしまいましたが問題ありませんでした。

(省略)
✨  Done in 17.93s.

install成功!

そして今度こそ!!
$ bin/rails s

=> Booting Puma
=> Rails 6.0.2.2 application starting in development 
=> Run `rails server --help` for more startup options
Puma starting in single mode...
* Version 4.3.3 (ruby 2.6.3-p62), codename: Mysterious Traveller
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://127.0.0.1:3000
* Listening on tcp://[::1]:3000
Use Ctrl-C to stop

railsサーバー無事起動しました^^

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