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

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

新規登録して質問してみよう
ただいま回答率
85.46%
Ruby on Rails

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

Q&A

解決済

1回答

358閲覧

rails sが実行されません

moyasi-

総合スコア3

Ruby on Rails

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

0グッド

0クリップ

投稿2021/07/01 22:35

編集2021/07/02 15:42

rails sを実行したところ下記のように表示されました。

$ rails s C:/Ruby27-x64/lib/ruby/2.7.0/rubygems.rb:277:in `find_spec_for_exe': Could not find 'bundler' (2.2.21) required by your C:/Users/environment/sample_app/Gemfile.lock. (Gem::GemNotFoundException) To update to the latest version installed on your system, run `bundle update --bundler`. To install the missing version, run `gem install bundler:2.2.21` from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems.rb:254:in `bin_path' from C:/Ruby27-x64/lib/ruby/2.7.0/bundler/rubygems_integration.rb:223:in `bin_path' from C:/Ruby27-x64/lib/ruby/2.7.0/bundler/shared_helpers.rb:297:in `set_bundle_variables' from C:/Ruby27-x64/lib/ruby/2.7.0/bundler/shared_helpers.rb:76:in `set_bundle_environment' from C:/Ruby27-x64/lib/ruby/2.7.0/bundler/runtime.rb:22:in `setup' from C:/Ruby27-x64/lib/ruby/2.7.0/bundler.rb:149:in `setup' from C:/Ruby27-x64/lib/ruby/2.7.0/bundler/setup.rb:20:in `block in <top (required)>' from C:/Ruby27-x64/lib/ruby/2.7.0/bundler/ui/shell.rb:136:in `with_level' from C:/Ruby27-x64/lib/ruby/2.7.0/bundler/ui/shell.rb:88:in `silence' from C:/Ruby27-x64/lib/ruby/2.7.0/bundler/setup.rb:20:in `<top (required)>' from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require' from C:/Ruby27-x64/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require' from C:/Users/yutok/environment/sample_app/config/boot.rb:3:in `<top (required)>' from bin/rails:3:in `require_relative' from bin/rails:3:in `<main>'

なのでbundle update --bundlerを実行しました。

$ bundle update Fetching gem metadata from https://rubygems.org/............. Resolving dependencies........ Using rake 13.0.3 Using concurrent-ruby 1.1.9 Using i18n 1.8.10 Using minitest 5.14.4 Using tzinfo 2.0.4 Using zeitwerk 2.4.2 Using activesupport 6.1.4 Using builder 3.2.4 Using erubi 1.10.0 Using racc 1.5.2 Using nokogiri 1.11.7 (x64-mingw32) Using rails-dom-testing 2.0.3 Using crass 1.0.6 Using loofah 2.10.0 Using rails-html-sanitizer 1.3.0 Using actionview 6.1.4 Using rack 2.2.3 Using rack-test 1.1.0 Using actionpack 6.1.4 Using nio4r 2.5.7 Using websocket-extensions 0.1.5 Using websocket-driver 0.7.5 Using actioncable 6.1.4 Using globalid 0.4.2 Using activejob 6.1.4 Using activemodel 6.1.4 Using activerecord 6.1.4 Using marcel 1.0.1 Using mini_mime 1.1.0 Using activestorage 6.1.4 Using mail 2.7.1 Using actionmailbox 6.1.4 Using actionmailer 6.1.4 Using actiontext 6.1.4 Using public_suffix 4.0.6 Using addressable 2.7.0 Using bindex 0.8.1 Using msgpack 1.4.2 Using bootsnap 1.7.5 Using bundler 2.2.21 Using byebug 11.1.3 Using regexp_parser 2.1.1 Using xpath 3.2.0 Using capybara 3.35.3 Using childprocess 3.0.0 Using ffi 1.15.3 (x64-mingw32) Using jbuilder 2.11.2 Using method_source 1.0.0 Using puma 5.3.2 Using rack-mini-profiler 2.3.2 Using rack-proxy 0.7.0 Using thor 1.1.0 Using railties 6.1.4 Using sprockets 4.0.2 Using sprockets-rails 3.2.2 Using rails 6.1.4 Using rubyzip 2.3.0 Using sassc 2.4.0 (x64-mingw32) Using tilt 2.0.10 Using sassc-rails 2.1.2 Using sass-rails 6.0.0 Using selenium-webdriver 3.142.7 Using semantic_range 3.0.0 Using sqlite3 1.4.2 Using turbolinks-source 5.2.0 Using turbolinks 5.2.1 Using tzinfo-data 1.2021.1 Using web-console 4.1.0 Using webdrivers 4.6.0 Using webpacker 5.4.0 Bundle updated!

その後rails sを実行するも最初と同じように表示されてしまいます。

$ bundler -v Bundler version 2.2.21

このようにバージョンは間違っていないようです。
環境はwindowsです。
皆様の知恵をお貸しください。

後述
なんとかlinux環境下でrails sを実行することができました。
参考にさせていただいたページを載せておきます。
この通りにやったらできました。
https://qiita.com/ksh-fthr/items/64a4e86c8bad08322c94

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

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

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

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

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

guest

回答1

0

ベストアンサー

環境はwindowsです。

過去質問でも良く出てきていて皆さん同じところで詰まっているのですけど、
Windows直にRails環境構築は茨の道でしかないので、仮想環境なりWSLなりLinux環境下に構築してください。

投稿2021/07/01 22:58

m.ts10806

総合スコア80861

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

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

moyasi-

2021/07/02 15:39

ありがとうございます。 おかげでrails sをLinux環境下で実行できました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.46%

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

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

質問する

関連した質問