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

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

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

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

Q&A

解決済

1回答

839閲覧

rails sができない

00tamanegi00

総合スコア1

Ruby on Rails

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

0グッド

1クリップ

投稿2020/06/12 06:55

編集2020/06/12 16:28

前提・実現したいこと

progateでrailsの環境構築をやっています。
『5. ローカルでRailsサーバを立てる』のrails sでつまずきました。

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

Could not find gem 'therubyracer' in any of the gem sources listed in your Gemfile.
Run bundle install to install missing gems.

該当のソースコード

ソースコード

試したこと

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.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

An error occurred while installing libv8 (3.16.14.19), and Bundler
cannot continue.
Make sure that gem install libv8 -v '3.16.14.19' --source 'https://rubygems.org/' succeeds before bundling.

補足情報(FW/ツールのバージョンなど)

ruby 2.7.1
rails 5.2.4.3

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

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

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

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

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

guest

回答1

0

ベストアンサー

ruby 2.7.1
rails 5.2.4.3

最新のrubyを使われていますが、よほどの理由がなければ、推奨版2.6.6をお勧めします。

RubyInstallers
WHICH VERSION TO DOWNLOAD?
If you don’t know what version to install and you’re getting started with Ruby, we recommend you use Ruby+Devkit 2.6.X (x64) installer.

ruby 2.6.6
Rails 5.2.4.3
で問題なくインストール、動作できています。

D:\Users\owner\Documents\ruby>bundle exec rails s => Booting Puma => Rails 5.2.4.3 application starting in development => Run `rails server -h` for more startup options *** SIGUSR2 not implemented, signal based restart unavailable! *** SIGUSR1 not implemented, signal based restart unavailable! *** SIGHUP not implemented, signal based logs reopening unavailable! Puma starting in single mode... * Version 3.12.6 (ruby 2.6.6-p146), codename: Llamas in Pajamas * Min threads: 5, max threads: 5 * Environment: development * Listening on tcp://localhost:3000 Use Ctrl-C to stop

投稿2020/06/13 04:37

technocore

総合スコア7337

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

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

00tamanegi00

2020/06/13 10:26

回答ありがとうございます。 データを全て消して Ruby 2.6.6 rails 5.2.4.3 にしてrails sを実行しましたがエラーになります。 Traceback (most recent call last): 61: from bin/rails:3:in `<main>' 60: from bin/rails:3:in `load' 59: from /Users/yudai/sample_app/bin/spring:15:in `<top (required)>' 58: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' 57: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' 56: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>' 55: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load' 54: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/spring-2.1.0/bin/spring:49:in `<top (required)>' 53: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client.rb:30:in `run' 52: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call' 51: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call' 50: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load' 49: from /Users/yudai/sample_app/bin/rails:9:in `<top (required)>' 48: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require' 47: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency' 46: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `block in require' 45: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 44: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 43: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' 42: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' 41: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' 40: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/commands.rb:18:in `<main>' 39: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/command.rb:46:in `invoke' 38: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/command/base.rb:69:in `perform' 37: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch' 36: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command' 35: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run' 34: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/commands/server/server_command.rb:142:in `perform' 33: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/commands/server/server_command.rb:142:in `tap' 32: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/railties-5.2.4.3/lib/rails/commands/server/server_command.rb:145:in `block in perform' 31: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require' 30: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency' 29: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `block in require' 28: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 27: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 26: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' 25: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' 24: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' 23: from /Users/yudai/sample_app/config/application.rb:7:in `<main>' 22: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/2.6.0/bundler.rb:114:in `require' 21: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/2.6.0/bundler/runtime.rb:65:in `require' 20: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/2.6.0/bundler/runtime.rb:65:in `each' 19: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/2.6.0/bundler/runtime.rb:76:in `block in require' 18: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/2.6.0/bundler/runtime.rb:76:in `each' 17: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/2.6.0/bundler/runtime.rb:81:in `block (2 levels) in require' 16: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 15: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 14: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' 13: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' 12: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' 11: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/uglifier-4.2.0/lib/uglifier.rb:5:in `<main>' 10: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require' 9: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency' 8: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `block in require' 7: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 6: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 5: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' 4: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' 3: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' 2: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<main>' 1: from /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>' /Users/yudai/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
technocore

2020/06/14 01:21

あなたのバージョンでrailsは動作するので原因はインストール方法でしょう。 手順を見直してください。
00tamanegi00

2020/06/14 02:57

node.jsをインストールしたら動作できました! ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.35%

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

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

質問する

関連した質問