mysql - 安装 mysql2 0.3.13

标签 mysql ruby-on-rails

我无法找到有关如何安装 gem mysql2-0.3.13 以及如何启动和运行 ruby​​ on rails 应用程序的良好说明。谁能分解这个过程?当我尝试安装 gem 时,出现此错误:
我正在使用 rails 3.2.13 和 ruby​​ 1.9.3 以及 mac OSX

Fetching gem metadata from https://rubygems.org/.........  
Fetching gem metadata from https://rubygems.org/..  
/Users/sumitkalra1984/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler.rb:284: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
Using rake (10.1.0)   
Using i18n (0.6.5)   
Using minitest (4.7.5)   
Using multi_json (1.7.9)   
Using atomic (1.1.13)   
Using thread_safe (0.1.2)   
Using tzinfo (0.3.37)   
Using activesupport (4.0.0)   
Using builder (3.1.4)   
Using erubis (2.7.0)   
Using rack (1.5.2)   
Using rack-test (0.6.2)   
Using actionpack (4.0.0)   
Using mime-types (1.24)   
Using polyglot (0.3.3)   
Using treetop (1.4.15)   
Using mail (2.5.4)   
Using actionmailer (4.0.0)   
Using activemodel (4.0.0)   
Using activerecord-deprecated_finders (1.0.3)   
Using arel (4.0.0)   
Using activerecord (4.0.0)   
Using thor (0.18.1)   
Using railties (4.0.0)   
Using activerecord-session_store (0.0.1)   
Using bcrypt-ruby (3.1.1)   
Using coffee-script-source (1.6.3)   
Using execjs (2.0.0)   
Using coffee-script (2.2.0)   
Using coffee-rails (4.0.0)   
Using daemons (1.1.9)   
Using orm_adapter (0.4.0)   
Using warden (1.2.3)   
Using devise (3.0.3)   
Using eventmachine (1.0.3)   
Using multipart-post (1.2.0)   
Using faraday (0.8.8)   
Using hashie (2.0.5)   
Using hike (1.2.3)   
Using httpauth (0.2.0)   
Using jbuilder (1.5.0)   
Using jquery-rails (3.0.4)   
Using json (1.8.0)   
Using jwt (0.1.8)   
Using libv8 (3.16.14.3)   
Installing mysql2 (0.3.13)   
Errno::EACCES: Permission denied - /Users/sumitkalra1984/.rvm/gems/ruby-1.9.3-p448/gems/mysql2-0.3.13/MIT-LICENSE  
An error occurred while installing mysql2 (0.3.13), and Bundler cannot continue.  
Make sure that `gem install mysql2 -v '0.3.13'` succeeds before bundling.  

最佳答案

如果您遇到权限问题,请以 root 用户身份安装 gems 喜欢

sudo bundle install

请检查你是否正确安装了mysql 和安装 gem 类型之前的 Mysql2 gem

sudo apt-get install mysql-server libmysqlclient-dev libmysql-ruby

我不是 mac 用户,但它可以在 ubuntu 中使用。希望对您有所帮助。

关于mysql - 安装 mysql2 0.3.13,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18716796/

相关文章:

php - 小于不在 SQL 查询 PHP 中工作

mysql - mysql 上的错误说检查手册

php - 编写复杂内容过滤器的最有效方法是什么?

php - 如何将小时数添加到 mysql 数据库的时间戳类型字段

ruby-on-rails - 如何在Ruby on Rails中作为附件接收/上传模型中的音频文件?

c# - 使用 BCrypt.Net 模拟设计密码加密?

mysql - 如何临时更改 MySQL 中的值

mysql - 安装 Mysql2 gem Windows 8(已遵循的解决方案)

ruby-on-rails - 是否有用于在 Rails 中测试 Redis 逻辑的 gem?

mysql - ActiveRecord::NoDatabaseError: 未知数据库 'db/production' 运行时 "eb deploy"