- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我无法让 Rails 3.1RC4 与 mysql 一起使用...?
我刚刚制作了一个新的测试应用程序,但它也失败了?
我做了:rails new blog2 -d mysql
然后在我的 gemfile 中:gem 'mysql2'
在database.yml文件中:
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: blog2_development
pool: 5
username: root
password: password
socket: /tmp/mysql.sock
现在当我运行 Rails 时
我收到以下错误:
MacBook-van-T-Boeree:blog2 tboeree$ rails s
/Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3.6/lib/mysql2.rb:9:in `require': dlopen(/Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3.6/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3.6/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3.6/lib/mysql2/mysql2.bundle
from /Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3.6/lib/mysql2.rb:9:in `<top (required)>'
from /Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
from /Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each'
from /Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `block in require'
from /Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each'
from /Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `require'
from /Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.15/lib/bundler.rb:120:in `require'
from /Users/tboeree/Dropbox/rails_projects/blog2/config/application.rb:7:in `<top (required)>'
from /Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.0.rc4/lib/rails/commands.rb:52:in `require'
from /Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.0.rc4/lib/rails/commands.rb:52:in `block in <top (required)>'
from /Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.0.rc4/lib/rails/commands.rb:49:in `tap'
from /Users/tboeree/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.0.rc4/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
捆绑安装:
MacBook-van-T-Boeree:blog2 tboeree$ bundle install
Using rake (0.9.2)
Using multi_json (1.0.3)
Using activesupport (3.1.0.rc4)
Using bcrypt-ruby (2.1.4)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.0.rc4)
Using erubis (2.7.0)
Using rack (1.3.2)
Using rack-cache (1.0.2)
Using rack-mount (0.8.2)
Using rack-test (0.6.1)
Using hike (1.2.0)
Using tilt (1.3.2)
Using sprockets (2.0.0.beta.13)
Using tzinfo (0.3.29)
Using actionpack (3.1.0.rc4)
Using mime-types (1.16)
Using polyglot (0.3.2)
Using treetop (1.4.10)
Using mail (2.3.0)
Using actionmailer (3.1.0.rc4)
Using arel (2.1.4)
Using activerecord (3.1.0.rc4)
Using activeresource (3.1.0.rc4)
Using ansi (1.3.0)
Using bundler (1.0.15)
Using coffee-script-source (1.1.2)
Using execjs (1.2.4)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using rdoc (3.9.1)
Using thor (0.14.6)
Using railties (3.1.0.rc4)
Using jquery-rails (1.0.12)
Using mysql2 (0.3.6)
Using rails (3.1.0.rc4)
Using sass (3.1.7)
Using sass-rails (3.1.0.rc.5)
Using turn (0.8.2)
Using uglifier (1.0.0)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
我正在 macbook 上工作,当我输入 mysql --version 时,我安装了 32 位版本的 mysql --version 我看到这个版本:mysql Ver 14.14 Distrib 5.5.15, for osx10.6 (i386) using readline 5.1
服务器已启动...
有什么建议吗?问候,泰斯
最佳答案
查看其他答案后,您需要将 mysql gem 指向您安装的库
sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib ~/.rvm/gems/ruby-1.9.2-p136/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
是魔法命令
关于mysql - 在rails 3.1RC4上使用mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7011452/
我很好奇这两个模块在实践中有什么区别吗?如果不是,为什么会有这两个副本? 最佳答案 std::rc::Rc只是 alloc::rc::Rc 的再导出.你可以在src/std/lib.rs中看到整个rc
我注意到 rust 书推荐使用 Rc::clone(&rc)在rc.clone()如下: use std::rc::Rc; let five = Rc::new(5); // recommended
我需要将我现有的 Angular 2 RC 1 应用程序迁移到 Angular 2 RC 4。作为其中的一部分,我还需要将我现有的表单迁移到 Angular 2 RC 4 New Forms。 任何人
如何测试 Selenium RC 中哪个元素具有焦点? 最佳答案 当我遇到同样的问题时,出于各种原因,其他答案都不适合我。我最终做了以下操作(使用 Java 中的 Selenium 2.0 WebDr
Horse是一个实现 Animal 的结构特征。我有一个 Rc和一个需要接收 Rc 的函数, 所以我想从 Rc 转换至 Rc . 我这样做了: use std::rc::Rc; struct Hors
代码如下所示: // Simplified pub trait Field: Send + Sync + Clone { fn name(&self); } #[deriving(Clone)
在 /etc/rc[06].d/ 目录中的程序启动之后,系统的启动就已经完成。不过,我们总有一些程序是需要在系统启动之后随着系统一起启动的。这时我们并不需要自己把需要启动的服务链接到 /etc/rc3
我正在使用 selenium rc,我需要测试 flash。我需要单击 Flash 播放器上的允许按钮。 我只是需要一些帮助才能开始? 最佳答案 通常,除非在 Flash 开发人员的帮助下将 Sele
我知道 PhantomData旨在使用数据类型定义中的生命周期或类型参数,否则这些参数将不会被使用。我最近在查看 Rc 的定义在Rust std lib并注意到它似乎使用了 PhantomData ,
谁能给我解释一下为什么Rc<>不是 Copy ? 我正在编写使用大量共享指针的代码,并且必须输入 .clone()总是让我心烦意乱。 在我看来Rc<>应该只包含一个固定大小的指针,所以类型本身应该是
我想创建一个 Rc因为我想减少跟踪访问 Rc 的 2 个指针的间接访问需要。我需要使用 Rc因为我确实拥有共享所有权。我在 another question 中详细说明关于我的字符串类型的更具体的问题
Selenium IDE 和 Selenium RC 的功能有什么区别? 最佳答案 Selenium IDE 是一个 firefox 插件,它为您提供了用于记录测试的基本记录器。这些测试使用关键字记录
我正在尝试使用 Selenium RC (Java) 在 Paypal-Sandbox 上购买东西,但它不起作用。 我用 Selenium IDE (Firefox AddOn) 试过了,它确实有效。
我有一个 Rc>但需要得到一个Rc从中。像这样的东西: let rc_option: Rc> = Rc::new(Ok(value)); let ok_value: Rc = rc_option.ma
我知道在 matplotlib 中,您可以使用 rc 或 rcParams 来自定义绘图的样式。但是,这些函数似乎存在于两个级别,例如 matplotlib.rc 与 matplotlib.pyplo
Rust 文档涵盖 Rc>相当广泛,但不涉及 RefCell> ,我现在遇到了。 这些是否有效地给出了相同的结果?它们之间有重要区别吗? 最佳答案 Do these effectively give
我有一段代码是这样的: use std::cell::RefCell; use std::rc::Rc; struct A(bool); impl A { fn get_ref(&self)
Rust 文档涵盖 Rc>相当广泛,但不涉及 RefCell> ,我现在遇到了。 这些是否有效地给出了相同的结果?它们之间有重要区别吗? 最佳答案 Do these effectively give
我试图获得引用计数 Rc从 HashMap 并将其放入不同的容器 ( Vec )。 原以为这会起作用(通过增加引用计数),但我却收到了一个“expected struct std::rc::Rc ,
前言 我们在ubuntu下要把一个程序加入开机启动,一般可以通过修改rc.local来完成,但ubuntu下有两个rc.local文件。分别是/etc/rc.local和/etc/init.d/r
我是一名优秀的程序员,十分优秀!