前提・実現したいこと
昨日ruby on railsを触り始めた超初心者です。
ruby on railsのローカルサーバーを建てたいです。
前提として
macを使用しています
ターミナルを使用しています
下記をインストールしています
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
Homebrew 2.3.0
rbenv 1.1.2
Rails 5.2.4.3
sample_appというフォルダを作成しています
railsのローカルサーバーを建てようと『rails s』を入力したのですが
下記のように表示されてサーバーが建てられていない状態です。
発生している問題・エラーメッセージ
ishiwatahiroshishou@MacBook-Pro sample_app % rails s
Traceback (most recent call last):
61: from bin/rails:3:in <main>' 60: from bin/rails:3:in
load'
59: from /Users/ishiwatahiroshishou/sample_app/bin/spring:15:in <top (required)>' 58: from /Users/ishiwatahiroshishou/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:72:in
require'
57: from /Users/ishiwatahiroshishou/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:72:in require' 56: from /Users/ishiwatahiroshishou/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/runtime.rb:58:in
each'
----------------------------------文字数の都合で中略--------------------------------
19: from /Users/ishiwatahiroshishou/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/runtime.rb:69:in `block in require' 18: from /Users/ishiwatahiroshishou/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/runtime.rb:69:in `each' 17: from /Users/ishiwatahiroshishou/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/runtime.rb:74:in `block (2 levels) in require' 16: from /Users/ishiwatahiroshishou/.rbenv/versions/2.6.5/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/ishiwatahiroshishou/.rbenv/versions/2.6.5/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/ishiwatahiroshishou/.rbenv/versions/2.6.5/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/ishiwatahiroshishou/.rbenv/versions/2.6.5/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/ishiwatahiroshishou/.rbenv/versions/2.6.5/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/ishiwatahiroshishou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/uglifier-4.2.0/lib/uglifier.rb:5:in `<main>' 10: from /Users/ishiwatahiroshishou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require' 9: from /Users/ishiwatahiroshishou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency' 8: from /Users/ishiwatahiroshishou/.rbenv/versions/2.6.5/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/ishiwatahiroshishou/.rbenv/versions/2.6.5/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/ishiwatahiroshishou/.rbenv/versions/2.6.5/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/ishiwatahiroshishou/.rbenv/versions/2.6.5/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/ishiwatahiroshishou/.rbenv/versions/2.6.5/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/ishiwatahiroshishou/.rbenv/versions/2.6.5/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/ishiwatahiroshishou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<main>' 1: from /Users/ishiwatahiroshishou/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
/Users/ishiwatahiroshishou/.rbenv/versions/2.6.5/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)
ishiwatahiroshishou@MacBook-Pro sample_app % ruby -v
試したこと
gemをインストールしましたgem install bundler:1.17.2
gemファイル内には下記の様に入力しています
frozen_string_literal: ture
source "https://rubygems.org"
git_source(:github) {|repo_name| "http://github.com/#{repo_name}" }
gem "rails"
gem "sass"
~
"~/Gemfile" 8L, 156C
上記をインストールした上で『rails s』をしても結果は同じでした。
恐れ入りますが有識者の方々お力を貸していただけませんでしょうか。
何卒よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/06/04 01:57
2020/06/04 02:04