前提・実現したいこと
railsでのbundle installをしたいです。
railsで動作確認行いたいと思っています。そこでbundle installをするとたくさんのエラーが発生します。Qiitaなどで解決方法を探したのですが、どうも解決することが出来ませんでした。
読みづらいですが、助けていただいたら幸いです。
よろしくお願いいたします。
発生しているエラーメッセージ
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
該当のソースコード
***@DESKTOP-NMIJ1RR:~/sample$ bundle install The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. Fetching source index from https://rubygems.org/ Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/ Resolving dependencies............................. Using rake 13.0.6 Using concurrent-ruby 1.1.9 Using i18n 1.9.1 Using minitest 5.15.0 Using tzinfo 2.0.4 Using activesupport 7.0.1 Using builder 3.2.4 Using erubi 1.10.0 Using mini_portile2 2.7.1 Fetching racc 1.6.0 Installing racc 1.6.0 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /home/reo/sample/vendor/bundle/ruby/2.7.0/gems/racc-1.6.0/ext/racc/cparse /usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20220131-73-16j8y2r.rb extconf.rb mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h You might have to install separate package for the ruby development environment, ruby-dev or ruby-devel for example. extconf failed, exit code 1 Gem files will remain installed in /home/reo/sample/vendor/bundle/ruby/2.7.0/gems/racc-1.6.0 for inspection. Results logged to /home/reo/sample/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/racc-1.6.0/gem_make.out An error occurred while installing racc (1.6.0), and Bundler cannot continue. Make sure that `gem install racc -v '1.6.0' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: rails was resolved to 7.0.1, which depends on actioncable was resolved to 7.0.1, which depends on actionpack was resolved to 7.0.1, which depends on actionview was resolved to 7.0.1, which depends on rails-dom-testing was resolved to 2.0.3, which depends on nokogiri was resolved to 1.13.1, which depends on racc
試したこと
gem install racc -v '1.6.0'の実行してみたのですが解決できませんでした。
補足情報(FW/ツールのバージョンなど)
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
railsのバージョンを確認しても、
Could not find gem 'rails (~> 7.0.1)' in any of the gem sources listed in your Gemfile.
とエラー文が出るが、bundle installが失敗してしまいます。

下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
また依頼した内容が修正された場合は、修正依頼を取り消すようにしましょう。
2022/02/02 13:11