質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.49%
WSL(Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) は、Windows10のOS上でLinux向けのバイナリプログラムを実行可能にする機能です。また、WindowsOSのAPIを用いた仕組みを提供しており、Linux側からWindowsOSへのファイルアクセスもできます。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

0回答

870閲覧

rails sが上手くいきません。

RinoSuebayashi

総合スコア4

WSL(Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) は、Windows10のOS上でLinux向けのバイナリプログラムを実行可能にする機能です。また、WindowsOSのAPIを用いた仕組みを提供しており、Linux側からWindowsOSへのファイルアクセスもできます。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2022/03/04 06:37

編集2022/03/04 06:38

前提・実現したいこと

下記サイトを参考にしながら、WSLでRuby on Railsの環境構築をしています。
https://dannex.jp/wsl-%E3%81%A7-ruby-on-rails-%E7%92%B0%E5%A2%83%E6%A7%8B%E7%AF%89%E3%80%80vs-code#toc1

発生している問題・エラーメッセージ

rails sコマンドを実行したところ、このようなエラーが返ってきました。↓

○○:~/△△/test-app$ rails s Could not find gem 'rails (~> 5.2.3)' in any of the gem sources listed in your Gemfile. Run `bundle install` to install missing gems.

指示通り、bundle installコマンドを実行したところ、このようなエラーが返ってきました。
解決策が分かる方、どうかご教授お願い致します。
※長かったので、省略してよさそうなところは省略しています。

Fetching gem metadata from https://rubygems.org/........... Resolving dependencies..... Using rake 13.0.6 Following files may not be writable, so sudo is needed: ・ ・ ・ Your user account isn't allowed to install to the system RubyGems. You can cancel this installation and run: bundle config set --local path 'vendor/bundle' bundle install to install the gems into ./vendor/bundle/, or you can enter your password and install the bundled gems to RubyGems using sudo. ・ ・ ・ Bundler::GemNotFound: Could not find thread_safe-0.3.6.gem for installation ・ ・ ・ An error occurred while installing thread_safe (0.3.6), and Bundler cannot continue. In Gemfile: rails was resolved to 5.2.6.2, which depends on actioncable was resolved to 5.2.6.2, which depends on actionpack was resolved to 5.2.6.2, which depends on actionview was resolved to 5.2.6.2, which depends on rails-dom-testing was resolved to 2.0.3, which depends on activesupport was resolved to 5.2.6.2, which depends on tzinfo was resolved to 1.2.9, which depends on thread_safe Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /tmp/bundler20220304-392-sed625racc-1.6.0/gems/racc-1.6.0/ext/racc/cparse /usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20220304-392-sl4v0p.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 /tmp/bundler20220304-392-sed625racc-1.6.0/gems/racc-1.6.0 for inspection. Results logged to /tmp/bundler20220304-392-sed625racc-1.6.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. In Gemfile: rails was resolved to 5.2.6.2, which depends on actioncable was resolved to 5.2.6.2, which depends on actionpack was resolved to 5.2.6.2, which depends on actionview was resolved to 5.2.6.2, which depends on rails-dom-testing was resolved to 2.0.3, which depends on nokogiri was resolved to 1.13.3, which depends on racc Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /tmp/bundler20220304-392-pcvsmwnio4r-2.5.8/gems/nio4r-2.5.8/ext/nio4r /usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20220304-392-wi8yxm.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 /tmp/bundler20220304-392-pcvsmwnio4r-2.5.8/gems/nio4r-2.5.8 for inspection. Results logged to /tmp/bundler20220304-392-pcvsmwnio4r-2.5.8/extensions/x86_64-linux/2.7.0/nio4r-2.5.8/gem_make.out ・ ・ ・ An error occurred while installing nio4r (2.5.8), and Bundler cannot continue. In Gemfile: rails was resolved to 5.2.6.2, which depends on actioncable was resolved to 5.2.6.2, which depends on nio4r Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /tmp/bundler20220304-392-gjrnzcbindex-0.8.1/gems/bindex-0.8.1/ext/skiptrace /usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20220304-392-1hicxa5.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 /tmp/bundler20220304-392-gjrnzcbindex-0.8.1/gems/bindex-0.8.1 for inspection. Results logged to /tmp/bundler20220304-392-gjrnzcbindex-0.8.1/extensions/x86_64-linux/2.7.0/bindex-0.8.1/gem_make.out ・ ・ ・ An error occurred while installing bindex (0.8.1), and Bundler cannot continue. In Gemfile: web-console was resolved to 3.7.0, which depends on bindex Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /tmp/bundler20220304-392-sjnx9amsgpack-1.4.5/gems/msgpack-1.4.5/ext/msgpack /usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20220304-392-9mb0z3.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 /tmp/bundler20220304-392-sjnx9amsgpack-1.4.5/gems/msgpack-1.4.5 for inspection. Results logged to /tmp/bundler20220304-392-sjnx9amsgpack-1.4.5/extensions/x86_64-linux/2.7.0/msgpack-1.4.5/gem_make.out ・ ・ ・ An error occurred while installing msgpack (1.4.5), and Bundler cannot continue. In Gemfile: bootsnap was resolved to 1.10.3, which depends on msgpack Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /tmp/bundler20220304-392-oh19xspuma-3.12.6/gems/puma-3.12.6/ext/puma_http11 /usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20220304-392-1s2lx4w.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 /tmp/bundler20220304-392-oh19xspuma-3.12.6/gems/puma-3.12.6 for inspection. Results logged to /tmp/bundler20220304-392-oh19xspuma-3.12.6/extensions/x86_64-linux/2.7.0/puma-3.12.6/gem_make.out ・ ・ ・ An error occurred while installing puma (3.12.6), and Bundler cannot continue. In Gemfile: puma Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /tmp/bundler20220304-392-z3wxo7sqlite3-1.4.2/gems/sqlite3-1.4.2/ext/sqlite3 /usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20220304-392-i0491p.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 /tmp/bundler20220304-392-z3wxo7sqlite3-1.4.2/gems/sqlite3-1.4.2 for inspection. Results logged to /tmp/bundler20220304-392-z3wxo7sqlite3-1.4.2/extensions/x86_64-linux/2.7.0/sqlite3-1.4.2/gem_make.out /usr/lib/ruby/2.7.0/rubygems/ext/builder.rb:97:in `run' /usr/lib/ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:48:in `block in build' /usr/lib/ruby/2.7.0/tempfile.rb:291:in `open' /usr/lib/ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:30:in `build' /usr/lib/ruby/2.7.0/rubygems/ext/builder.rb:167:in `block in build_extension' /usr/lib/ruby/2.7.0/rubygems/ext/builder.rb:163:in `synchronize' /usr/lib/ruby/2.7.0/rubygems/ext/builder.rb:163:in `build_extension' /usr/lib/ruby/2.7.0/rubygems/ext/builder.rb:208:in `block in build_extensions' /usr/lib/ruby/2.7.0/rubygems/ext/builder.rb:205:in `each' /usr/lib/ruby/2.7.0/rubygems/ext/builder.rb:205:in `build_extensions' /usr/lib/ruby/2.7.0/rubygems/installer.rb:844:in `build_extensions' /var/lib/gems/2.7.0/gems/bundler-2.3.8/lib/bundler/rubygems_gem_installer.rb:71:in `build_extensions' /var/lib/gems/2.7.0/gems/bundler-2.3.8/lib/bundler/rubygems_gem_installer.rb:28:in `install' /var/lib/gems/2.7.0/gems/bundler-2.3.8/lib/bundler/source/rubygems.rb:204:in `install' /var/lib/gems/2.7.0/gems/bundler-2.3.8/lib/bundler/installer/gem_installer.rb:54:in `install' /var/lib/gems/2.7.0/gems/bundler-2.3.8/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec' /var/lib/gems/2.7.0/gems/bundler-2.3.8/lib/bundler/installer/parallel_installer.rb:186:in `do_install' /var/lib/gems/2.7.0/gems/bundler-2.3.8/lib/bundler/installer/parallel_installer.rb:177:in `block in worker_pool' /var/lib/gems/2.7.0/gems/bundler-2.3.8/lib/bundler/worker.rb:62:in `apply_func' /var/lib/gems/2.7.0/gems/bundler-2.3.8/lib/bundler/worker.rb:57:in `block in process_queue' /var/lib/gems/2.7.0/gems/bundler-2.3.8/lib/bundler/worker.rb:54:in `loop' /var/lib/gems/2.7.0/gems/bundler-2.3.8/lib/bundler/worker.rb:54:in `process_queue' /var/lib/gems/2.7.0/gems/bundler-2.3.8/lib/bundler/worker.rb:91:in `block (2 levels) in create_threads' An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue. In Gemfile: sqlite3

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.49%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問