here的所有方法我都试过了. 但是,还是会出现同样的错误。
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.
我的规范是:
MacOS Mojave 10.14.1
ruby 2.5.3p105
带有自制软件的 Mysql 8.0.12
gem 文件:
gem "rails"
gem "mysql2", "0.5.2"
你能告诉我一个解决方案吗?
最佳答案
这是一个很好的帖子。我在使用 mac 时遇到了同样的问题。我最终做的是以下内容。
我更改了 Gemfile 的权限。我使用了
chmod 755 Gemfile
。我使用了
sudo bundle install
。这允许我在 Gemfile 中安装所有的 gem。我做了一个
rake db:create
和rails server
。
一切正常。希望它也能解决您的问题。
关于ruby-on-rails - "Mysql2"0.5.2版本安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53415815/