Nwbie在此。在遵循了一些安装和设置RubyonRails的指南之后,我在浏览器中打开服务器时出现了以下错误。
指南:
- https://www.youtube.com/watch?v=fmyvWz5TUWg&t=1567s&ab_channel=freeCodeCamp.org
- https://guides.rubyonrails.org/getting_started.html
Im使用这些版本的
- Ubuntu:20.04.03 LTS
- 红宝石:3.0.3
- 轨道:7.0.2.1
- SQLite3:3.31.1
- 节点:16.13.2
- 纱线1.22.17
Puma捕获到此错误:未定义的局部变量或方法
state' for ActiveSupport::IsolatedExecutionState:Module (NameError) /home/matias/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/activesupport-7.0.2.1/lib/active_support/isolated_execution_state.rb:45:in
删除'/home/matias/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/activesupport-7.0.2.1/lib/active_support/execution_wapper.rb:69:inrun!' /home/matias/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/actionpack-7.0.2.1/lib/action_dispatch/middleware/executor.rb:12:in
调用'/home/matias/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/actionpack-7.0.2.1/lib/action_dispatch/mediameter/static.rb:23:incall' /home/matias/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in
调用'/home/matias/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/actionpack-7.0.2.1/lib/action_dispatch/middleware/host_authorification.rb:137:在call' /home/matias/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/railties-7.0.2.1/lib/rails/engine.rb:530:in
调用中'/home/matias/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/puma-56.1/lib/puma/configuration.rb:252:在handle_request'中的call' /home/matias/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/puma-5.6.1/lib/puma/request.rb:77:in
块中/home/matias/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/puma-5.6/lib/puma/thread_pool.rb:340:在with_force_shutdown' /home/matias/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/puma-5.6.1/lib/puma/request.rb:76:in
handle_request'中/home/matias/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/puma-5.6/lib/puma/server.rb:441:在spawn_thread'中的process_client' /home/matias/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/puma-5.6.1/lib/puma/thread_pool.rb:147:in
块中
我不知道发生了什么,也找不到任何相关的话题。尝试重新安装所有东西,并使用不同的版本,相同的错误
提前感谢
已解决。
启动服务器开关sudo显示Ruby版本存在一些问题。
检查您如何安装ruby,确保安装干净。我建议删除所有内容,并从rbenv开始清理。
本指南制作了以下内容:https://www.youtube.com/watch?v=FfXd0XQ4QbY&list=FL1o8s2zTqBUnOqNxwtF8fHA&index=1&t=90s&ab_channel=apiske