首页 > 解决方案 > 尝试在 Mac book pro 上访问 Rails Sever 时出错

问题描述

我目前在 Mac OS Mojave 10.14 Beta 上使用

我已经从这里使用这种方法安装了所有东西

使用命令创建新的 Ruby 应用程序后

rails new sept_07 -d mysql

在那个命令之后我cd进入 sept_07,然后我运行了这个命令

bundle install

安装完成后我运行命令

rails server

我受到这些错误的欢迎

/Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require': dlopen(/Library/Ruby/Gems/2.3.0/gems/mysql2-0.5.2/lib/mysql2/mysql2.bundle, 0x0009): dependent dylib 'libssl.1.0.0.dylib' not found for '/Library/Ruby/Gems/2.3.0/gems/mysql2-0.5.2/lib/mysql2/mysql2.bundle' - /Library/Ruby/Gems/2.3.0/gems/mysql2-0.5.2/lib/mysql2/mysql2.bundle (LoadError)
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
from /Library/Ruby/Gems/2.3.0/gems/mysql2-0.5.2/lib/mysql2.rb:33:in `<main>'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Library/Ruby/Site/2.3.0/bundler/runtime.rb:81:in `block (2 levels) in require'
from /Library/Ruby/Site/2.3.0/bundler/runtime.rb:76:in `each'
from /Library/Ruby/Site/2.3.0/bundler/runtime.rb:76:in `block in require'
from /Library/Ruby/Site/2.3.0/bundler/runtime.rb:65:in `each'
from /Library/Ruby/Site/2.3.0/bundler/runtime.rb:65:in `require'
from /Library/Ruby/Site/2.3.0/bundler.rb:114:in `require'
from /Users/matt/Documents/Aurora University/Semesters/Fall 2018/DataBase/Projects/sept07/config/application.rb:7:in `<main>'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:145:in `block in perform'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:142:in `tap'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:142:in `perform'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.2.1/lib/rails/command/base.rb:65:in `perform'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.2.1/lib/rails/command.rb:46:in `invoke'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.2.1/lib/rails/commands.rb:18:in `<main>'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
from /Users/matt/Documents/Aurora University/Semesters/Fall 2018/DataBase/Projects/sept07/bin/rails:9:in `<top (required)>'
from /Library/Ruby/Gems/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
from /Library/Ruby/Gems/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
from /Library/Ruby/Gems/2.3.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
from /Library/Ruby/Gems/2.3.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
from /Library/Ruby/Gems/2.3.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
from /Library/Ruby/Gems/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
from /Library/Ruby/Gems/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
from /Library/Ruby/Site/2.3.0/rubygems/core_ext/kernel_require.rb:70:in `require'
from /Library/Ruby/Site/2.3.0/rubygems/core_ext/kernel_require.rb:70:in `require'
from /Users/matt/Documents/Aurora University/Semesters/Fall 2018/DataBase/Projects/sept07/bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'

我已尝试检查 sept_07 文件夹中的 database.yml 并更改匹配 mysql 用户的用户名和密码并通过并创建一个名为 sept_07 的数据库以匹配 database.yml 文件中的数据库。

任何帮助是极大的赞赏

谢谢

标签: mysqlruby-on-railsrubymacos-mojave

解决方案


推荐阅读