invalid address: (IPAddr::InvalidAddressError)でrails sができない
invalid address: (IPAddr::InvalidAddressError)というエラーが出てrails sできません。
例)
Railsチュートリアルで学習中です。ローカルのアプリの動きを確認しようとrails sを実行するとタイトルのアプリが出てきました。
記事を探して解決しようとしましたができませんでした。
解決方法を教えて下さい。
発生している問題・エラー
ターミナル
ec2-user:~/environment/アプリ名 (main) $ rails s
=> Booting Puma
=> Rails 7.0.4 application starting in development
=> Run `bin/rails server --help` for more startup options
Exiting
/home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/ipaddr.rb:684:in `in6_addr': invalid address: (IPAddr::InvalidAddressError)
from /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/ipaddr.rb:620:in `initialize'
from /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/ipaddr.rb:530:in `new'
from /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/ipaddr.rb:530:in `mask!'
from /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/ipaddr.rb:628:in `initialize'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/web-console-4.2.0/lib/web_console/permissions.rb:34:in `new'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/web-console-4.2.0/lib/web_console/permissions.rb:34:in `coerce_network_to_ipaddr'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/web-console-4.2.0/lib/web_console/permissions.rb:11:in `map'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/web-console-4.2.0/lib/web_console/permissions.rb:11:in `initialize'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/web-console-4.2.0/lib/web_console/railtie.rb:56:in `new'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/web-console-4.2.0/lib/web_console/railtie.rb:56:in `block in <class:Railtie>'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `instance_exec'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `run'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/railties-7.0.4/lib/rails/initializable.rb:61:in `block in run_initializers'
from /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
from /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each'
from /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `call'
from /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
from /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
from /home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/railties-7.0.4/lib/rails/initializable.rb:60:in `run_initializers'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/railties-7.0.4/lib/rails/application.rb:372:in `initialize!'
from /home/ec2-user/environment/rails_tutorial/config/environment.rb:5:in `<main>'
from config.ru:3:in `require_relative'
from config.ru:3:in `block in <main>'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/rack-2.2.6.2/lib/rack/builder.rb:116:in `eval'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/rack-2.2.6.2/lib/rack/builder.rb:116:in `new_from_string'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/rack-2.2.6.2/lib/rack/builder.rb:105:in `load_file'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/rack-2.2.6.2/lib/rack/builder.rb:66:in `parse_file'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/rack-2.2.6.2/lib/rack/server.rb:349:in `build_app_and_options_from_config'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/rack-2.2.6.2/lib/rack/server.rb:249:in `app'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/rack-2.2.6.2/lib/rack/server.rb:422:in `wrapped_app'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:76:in `log_to_stdout'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:36:in `start'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:143:in `block in perform'
from <internal:kernel>:90:in `tap'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:134:in `perform'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/railties-7.0.4/lib/rails/command/base.rb:87:in `perform'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/railties-7.0.4/lib/rails/command.rb:48:in `invoke'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /home/ec2-user/.rvm/gems/ruby-3.1.2/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from bin/rails:5:in `<main>'
自分で試したこと
ターミナル
Exiting
/home/ec2-user/.rvm/rubies/ruby-3.1.2/lib/ruby/3.1.0/ipaddr.rb:684:in `in6_addr'
: invalid address: (IPAddr::InvalidAddressError)
だったので、調べたのですが出てきませんでした。
わからなかったので、ぐちゃぐちゃに編集するようの新しいブランチを作り、bundle updateやbundle installやrails server --p 3000、rails s -b 0.0.0.0など手あたり次第試してみましたが結局同じエラーでした。
エラーの原因はアドレスの関係だと思うのですが、何のアドレスか、どうやって確認するのかというところでつまづいたため、進みませんでした。
解決のために必要な情報があれば書かせていただきますので、おっしゃってください。
詳しい方がいらっしゃればぜひお助けいただけないでしょうか。もしよろしければよろしくお願いいたします。
0