CentOS 7 使用ror出现的问题

2022-12-28 14:40:53 浏览数 (1)

  1. rails server
代码语言:javascript复制
$ rails server
=> Booting Puma
=> Rails 6.0.3.2 application starting in development 
=> Run `rails server --help` for more startup options
Exiting
Traceback (most recent call last):
        65: from bin/rails:4:in `<main>'
        64: from /usr/local/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `require'
        63: from /usr/local/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:291:in `load_dependency'
        62: from /usr/local/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `block in require'
        61: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        60: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        59: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        58: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        57: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        56: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/commands.rb:18:in `<main>'
        55: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/command.rb:46:in `invoke'
        54: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/command/base.rb:69:in `perform'
        53: from /usr/local/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
        52: from /usr/local/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
        51: from /usr/local/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
        50: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/commands/server/server_command.rb:138:in `perform'
        49: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/commands/server/server_command.rb:138:in `tap'
        48: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/commands/server/server_command.rb:147:in `block in perform'
        47: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/commands/server/server_command.rb:37:in `start'
        46: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout'
        45: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:422:in `wrapped_app'
        44: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:249:in `app'
        43: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:349:in `build_app_and_options_from_config'
        42: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
        41: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
        40: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
        39: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
        38: from config.ru:3:in `block in <main>'
        37: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:53:in `require_relative'
        36: from /usr/local/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `require'
        35: from /usr/local/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:291:in `load_dependency'
        34: from /usr/local/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `block in require'
        33: from /usr/local/lib/ruby/gems/2.7.0/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'
        32: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        31: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        30: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        29: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        28: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        27: from /home/rabbit/go/src/gitee.com/ReminderGroup/webdemo/_examples/blog/config/environment.rb:5:in `<main>'
        26: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/application.rb:363:in `initialize!'
        25: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/initializable.rb:60:in `run_initializers'
        24: from /usr/local/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each'
        23: from /usr/local/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each'
        22: from /usr/local/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component'
        21: from /usr/local/lib/ruby/2.7.0/tsort.rb:347:in `call'
        20: from /usr/local/lib/ruby/2.7.0/tsort.rb:347:in `each'
        19: from /usr/local/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component'
        18: from /usr/local/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from'
        17: from /usr/local/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        16: from /usr/local/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each'
        15: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/initializable.rb:61:in `block in run_initializers'
        14: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/initializable.rb:32:in `run'
        13: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/initializable.rb:32:in `instance_exec'
        12: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/railtie.rb:84:in `block in <class:Engine>'
        11: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker.rb:35:in `bootstrap'
        10: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/commands.rb:25:in `bootstrap'
         9: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/manifest.rb:18:in `refresh'
         8: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/manifest.rb:83:in `load'
         7: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:51:in `public_manifest_path'
         6: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:47:in `public_output_path'
         5: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:43:in `public_path'
         4: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:84:in `fetch'
         3: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:88:in `data'
         2: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:92:in `load'
         1: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:92:in `read'
/usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:92:in `read': No such file or directory @ rb_sysopen - /home/rabbit/go/src/gitee.com/ReminderGroup/webdemo/_examples/blog/config/webpacker.yml (Errno::ENOENT)
        64: from bin/rails:4:in `<main>'
        63: from /usr/local/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `require'
        62: from /usr/local/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:291:in `load_dependency'
        61: from /usr/local/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `block in require'
        60: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        59: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        58: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        57: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        56: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        55: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/commands.rb:18:in `<main>'
        54: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/command.rb:46:in `invoke'
        53: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/command/base.rb:69:in `perform'
        52: from /usr/local/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
        51: from /usr/local/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
        50: from /usr/local/lib/ruby/gems/2.7.0/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
        49: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/commands/server/server_command.rb:138:in `perform'
        48: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/commands/server/server_command.rb:138:in `tap'
        47: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/commands/server/server_command.rb:147:in `block in perform'
        46: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/commands/server/server_command.rb:37:in `start'
        45: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout'
        44: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:422:in `wrapped_app'
        43: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:249:in `app'
        42: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:349:in `build_app_and_options_from_config'
        41: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
        40: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
        39: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
        38: from /usr/local/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
        37: from config.ru:3:in `block in <main>'
        36: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:53:in `require_relative'
        35: from /usr/local/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `require'
        34: from /usr/local/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:291:in `load_dependency'
        33: from /usr/local/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.2/lib/active_support/dependencies.rb:324:in `block in require'
        32: from /usr/local/lib/ruby/gems/2.7.0/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'
        31: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        30: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        29: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        28: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        27: from /usr/local/lib/ruby/gems/2.7.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        26: from /home/rabbit/go/src/gitee.com/ReminderGroup/webdemo/_examples/blog/config/environment.rb:5:in `<main>'
        25: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/application.rb:363:in `initialize!'
        24: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/initializable.rb:60:in `run_initializers'
        23: from /usr/local/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each'
        22: from /usr/local/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each'
        21: from /usr/local/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component'
        20: from /usr/local/lib/ruby/2.7.0/tsort.rb:347:in `call'
        19: from /usr/local/lib/ruby/2.7.0/tsort.rb:347:in `each'
        18: from /usr/local/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component'
        17: from /usr/local/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from'
        16: from /usr/local/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        15: from /usr/local/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each'
        14: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/initializable.rb:61:in `block in run_initializers'
        13: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/initializable.rb:32:in `run'
        12: from /usr/local/lib/ruby/gems/2.7.0/gems/railties-6.0.3.2/lib/rails/initializable.rb:32:in `instance_exec'
        11: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/railtie.rb:84:in `block in <class:Engine>'
        10: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker.rb:35:in `bootstrap'
         9: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/commands.rb:25:in `bootstrap'
         8: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/manifest.rb:18:in `refresh'
         7: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/manifest.rb:83:in `load'
         6: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:51:in `public_manifest_path'
         5: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:47:in `public_output_path'
         4: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:43:in `public_path'
         3: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:84:in `fetch'
         2: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:88:in `data'
         1: from /usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:91:in `load'
/usr/local/lib/ruby/gems/2.7.0/gems/webpacker-4.3.0/lib/webpacker/configuration.rb:95:in `rescue in load': Webpacker configuration file not found /home/rabbit/go/src/gitee.com/ReminderGroup/webdemo/_examples/blog/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory @ rb_sysopen - /home/rabbit/go/src/gitee.com/ReminderGroup/webdemo/_examples/blog/config/webpacker.yml (RuntimeError)

看提示,运行rails webpacker:install 后重试命令解决

  1. 执行rails server后,访问http://localhost:3000/,提示Your version of SQLite (3.7.17) is too old. Active Record supports SQLite >= 3.8.
代码语言:javascript复制
# 下载源码,[官网](https://www.sqlite.org/download.html)
wget https://www.sqlite.org/2020/sqlite-autoconf-3330000.tar.gz
# 编译
$ tar -C ~/.local/ -zxvf sqlite-autoconf-3330000.tar.gz
$ cd ~/.local
$ mv sqlite-autoconf-3330000/ sqlite
$ cd sqlite
$ ./configure
$ make

# 替换系统低版本 sqlite3
$ whereis sqlite3
sqlite3: /usr/bin/sqlite3
# sudo cp sqlite3 /usr/bin/sqlite3

$ sqlite3 --version
3.33.0 2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f

$ gem uninstall sqlite3
$ gem install sqlite3

重启rails server,问题解决。

0 人点赞