前提・実現したいこと
Ruby、RonRで環境構築をしアプリケーション作成にとりかかっています。
rail s を実行しましたが以下の様なエラーが出ておりサーバーが起動しません。
発生している問題・エラーメッセージ
[WARNING] Could not load command "rails/commands/server/server_command". Error: uninitialized constant URI::Generic.
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri/ftp.rb:23:in <module:URI>' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri/ftp.rb:13:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri.rb:107:in require' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri.rb:107:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri/rfc2396_parser.rb:13:in require' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri/rfc2396_parser.rb:13:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri/common.rb:13:in require' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri/common.rb:13:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri/generic.rb:12:in require' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri/generic.rb:12:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/core_ext/object/json.rb:4:in require' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/core_ext/object/json.rb:4:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/core_ext/object.rb:11:in require' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/core_ext/object.rb:11:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/configuration.rb:2:in require' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/configuration.rb:2:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/railtie/configuration.rb:1:in require' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/railtie/configuration.rb:1:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/railtie.rb:218:in require' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/railtie.rb:218:in
config'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/railtie.rb:122:in config' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/i18n_railtie.rb:9:in
class:Railtie'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/i18n_railtie.rb:8:in <module:I18n>' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/i18n_railtie.rb:7:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/railtie.rb:2:in require' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-5.1.7/lib/active_support/railtie.rb:2:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails.rb:15:in require' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails.rb:15:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:4:in require' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/commands/server/server_command.rb:4:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/command/behavior.rb:82:in require' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/command/behavior.rb:82:in
block (2 levels) in lookup'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/command/behavior.rb:78:in each' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/command/behavior.rb:78:in
block in lookup'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/command/behavior.rb:77:in each' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/command/behavior.rb:77:in
lookup'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/command.rb:68:in find_by_namespace' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/command.rb:42:in
invoke'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/commands.rb:16:in <top (required)>' /Users/saitouhodo/Desktop/sample_app/bin/rails:9:in
require'
/Users/saitouhodo/Desktop/sample_app/bin/rails:9:in <top (required)>' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in
load'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in call' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/client/command.rb:7:in
call'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/client.rb:30:in run' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.1.0/bin/spring:49:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in load' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in
<top (required)>'
/Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in
require'
/Users/saitouhodo/Desktop/sample_app/bin/spring:15:in <top (required)>' bin/rails:3:in
load'
bin/rails:3:in <main>' /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri.rb:99: warning: already initialized constant URI::VERSION_CODE /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri.rb:99: warning: previous definition of VERSION_CODE was here /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri.rb:100: warning: already initialized constant URI::VERSION /Users/saitouhodo/.rbenv/versions/2.5.0/lib/ruby/2.5.0/uri.rb:100: warning: previous definition of VERSION was here rails aborted! Don't know how to build task 'server' (See the list of available tasks with
rails --tasks) /Users/saitouhodo/Desktop/sample_app/bin/rails:9:in
require'
/Users/saitouhodo/Desktop/sample_app/bin/rails:9:in <top (required)>' /Users/saitouhodo/Desktop/sample_app/bin/spring:15:in
<top (required)>'
bin/rails:3:in load' bin/rails:3:in
<main>'
(See full trace by running task with --trace)``
ご教授頂きたい事
1.上記のエラーはなぜ発生するのか。
2.どの様に解決すれば良いのか。
以上の2点が知りたいです。よろしくお願いします。
試したこと
・bundle exec rails s を実行しましたが同じエラーが出る
・ターミナルを再起動させても同じエラーが出る
補足情報(FW/ツールのバージョンなど)
OS mac
ruby 2.5.0
rbenv 1.1.2
Homebrew 2.2.5
Rails 5.1.7
エディタ
VScode(同ターミナルでも試しましたが同じエラーが出ました)
新規作成したappファイルの中身
Gemfile app db public
Gemfile.lock bin lib test
README.md config log tmp
Rakefile config.ru package.json vendor
あなたの回答
tips
プレビュー