为此,我已经花了好几天的脑筋,然后谷歌搜索。我已经在Stackoverflow上尝试了几种选择,但均未成功。大部分建议是对brew install mysql
的建议。
我已经通过FTP传输了rails(redmine)网络应用程序。我在应用程序的根目录中。运行任何rails
(例如rails --version
)命令都会导致以下错误结尾:
[...]
Could not find mysql2-0.5.2 in any of the sources
Run `bundle install` to install missing gems.
根据消息中的建议,我运行bundle install
,并得到熟悉的错误,包括:
[...]
Fetching mysql2 0.5.2
Installing mysql2 0.5.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
[...]
An error occurred while installing mysql2 (0.5.2), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
mysql2
根据消息中的建议,我运行gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'
ERROR: While executing gem ... (Errno::EACCES)
Permission denied @ rb_sysopen - /Users/frontwalkermalmo/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2/CHANGELOG.md
为了确定,我运行sudo gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'
,它会产生一些错误消息,其中包括:
[...]
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mysql2.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/[USER]/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2 for inspection.
Results logged to /Users/[USER]/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-18/2.5.0-static/mysql2-0.5.2/gem_make.out
运行mysql --version
会产生:
mysql Ver 14.14 Distrib 5.6.43, for osx10.14 (x86_64) using EditLine wrapper
我有一个wordpress网站,可以使用MAMP和mysql服务器在目录中正常工作。
问题[1]:这是否引起我无法安装mysql2 gem的任何问题?
此外,在Redmine项目应用程序的根目录中,运行mysqlserverinfo
时请给我:zsh: command not found: mysqlserverinfo
。
问题[2]:这有助于诊断问题吗?
此外,这也是echo $PATH
的输出:
/usr/local/opt/imagemagick@6/bin:/usr/local/opt/mysql@5.6/bin:/Users/[USER_ACCT]/.rbenv/shims:/Users/[USER_ACCT]/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin