在Mac上安装mysql2-0.2.6
我无法找到有关如何安装 mysql2-0.2.6 以及如何启动并运行 Ruby on Rails 应用程序的良好说明。有人可以分解这个过程吗?
当我尝试安装 gem 时,出现以下错误:
Installing mysql2 (0.2.6) /Library/Ruby/Site/1.8/rubygems/installer.rb:574:in `initialize': Permission denied - /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/.gitignore (Errno::EACCES)
I'm having trouble finding good instructions on how to install mysql2-0.2.6 and have it up and running for a ruby on rails application. Could anyone please break down this process?
When I try to install the gem, I get this error:
Installing mysql2 (0.2.6) /Library/Ruby/Site/1.8/rubygems/installer.rb:574:in `initialize': Permission denied - /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/.gitignore (Errno::EACCES)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
尝试
Try
找到 mysql_config 的路径
使用该路径安装 gem
为一堆 人。试一试。
编辑 - 缺少定位
确保您位于根目录,然后运行
sudo /usr/libexec/locate.updatedb
Locate your path to the mysql_config
Using that path install the gem
Worked for a bunch of people. Give it a whirl.
EDIT - for missing locate
make sure you're in the root and then run
sudo /usr/libexec/locate.updatedb
我认为这个权限错误可以通过执行以下操作来修复:
XCode->首选项->下载->组件选项卡 ->命令行工具:按下载
现在应该可以通过命令行安装了。
问候。伊里斯
I think this permission error can be fixed by doing:
XCode -> Preferences -> Downloads -> Components tab -> Command Line Tools: press download
Now it should be possible to install through command line.
Regards. Íris
这个错误主要发生在我们使用Ruby 1.9.3版本安装mysql2-0.2.6时。如果切换到Ruby 2.0,这个问题就会得到解决。 Ruby 1.9.3 已达到 EOL(https://github.com/sstephenson/rbenv/issues/712< /a>)并且 Ruby 核心团队没有提供支持。因此尝试 Ruby 1.9.3 是没有用的。
This error is mainly occurred when we install mysql2-0.2.6 with Ruby 1.9.3 version. If you switched to Ruby 2.0, this problem will be solved. Ruby 1.9.3 reached EOL(https://github.com/sstephenson/rbenv/issues/712) and no support has been given by Ruby core team. Hence there is no use to try with Ruby 1.9.3.