LoginSignup
0
0

More than 1 year has passed since last update.

コード譜投稿アプリを作る #1(アプリ構築)

Last updated at Posted at 2022-08-16

←前回の記事

今回はひとまずRailsのAPIモードとNext.jsのアプリケーションを作っていきます
環境はM1macです

Railsアプリ作成

この記事に書いてあることをコピペ参考にしてdockerを使って構築しました
ruby3系とRails7系は初めてだけど試すのには絶好の機会だしまぁええでしょ

詰まった点としてはdb:createする際に以下のようなエラーが出ました

/lib/aarch64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/bundle/gems/nokogiri-1.13.0-aarch64-linux/lib/nokogiri/3.1/nokogiri.so) - /usr/local/bundle/gems/nokogiri-1.13.0-aarch64-linux/lib/nokogiri/3.1/nokogiri.so

エラーを読むとforce_ruby_platformtrueにしてくれとのことだったので

Dockerfile
gem install bundler && bundle install

↑の部分を

gem install bundler && bundle config set force_ruby_platform true && bundle install

に変更したところ動きました。

image.png
なんかいつものyay!じゃないけど動いてそう

next.jsアプリ作成

この記事を参考に作りました(先人には感謝)
変えたところはサーバー側のポートと競合するので、

package.json
...
  "scripts": {
    "dev": "next dev -p 3001",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
...

上記のようにnextアプリのポートは3001番を指定しています。

image.png
表示完了。

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