ruby – 缺少mysql2 gem.将它添加到您的Gemfile:gem’mysql2′

栏目: Ruby · 发布时间: 7年前

内容简介:版本>ruby1.9.2-p290> rails 3.0.9

版本

>ruby1.9.2-p290

> rails 3.0.9

> rvm下的 mysql 2-0.2.13

> ubuntu 11.04

gem安装了“gem install mysql2 -v’<0.3'”.所有依赖都得到满足. 铁轨& ‘rails c’工作正常. 我需要使用activerecord 3.0.9在rails环境之外运行脚本.当我运行脚本时,这是输出: ======================

/home/ross/work/x/library/models.rb:27:in `eval': !!! Missing the mysql2 gem. Add it to your Gemfile: gem 'mysql2' (RuntimeError)
    from /home/ross/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/mysql_adapter.rb:19:in `mysql_connection'
    from /home/ross/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `new_connection' ....

=======================

很明显,宝石就在那里,因为铁轨有效.

不知道为什么在运行脚本时找不到gem?

任何人都可以对这个问题有所了解吗?

问候

罗斯


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Designing for Emotion

Designing for Emotion

Aarron Walter / Happy Cog / 2011-10-18 / USD 18.00

Make your users fall in love with your site via the precepts packed into this brief, charming book by MailChimp user experience design lead Aarron Walter. From classic psychology to case studies, high......一起来看看 《Designing for Emotion》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具