`

no such file to load -- mysql

阅读更多
也有多种情况罗列到一起吧


# MySQL. Versions 4.1 and 5.0 are recommended. 
# 
# Install the MySQL driver: 
# gem install mysql 
# On Mac OS X: 
# sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql 
# On Mac OS X Leopard: 
# sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config 

sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include


一下为linux情况

You may face some issues while configuring rails;

引用
no such file to load — mysql
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:65:in `mysql_connection’
and so on


step 1:
If you havn’t done “
gem install mysql
”; do it first.

step 2:
引用
If it doesn’t work even after “gem install mysql”; search for “mysql.so” in your system. In linux box; the path would be something like;
‘/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/mysql.so’


step 3:
In the error message; you will see the error file(mysql_adapter.rb); In my case it is [check error sample above];

引用
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:65:in `mysql_connection’


step 4:
Open the file “/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb” and go to location 65.

You will find a line something like;

require_library_or_gem(’mysql’)

change this line to look like;

require_library_or_gem(’/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/mysql.so’)


再不行参考如下
http://www.ruby-forum.com/topic/192550
分享到:
评论

相关推荐

    rails No route matches 错误的解决方法

    打开编辑, 找到如下行: # See how all your routes lay out with “rake routes” 在这行下面添加一行, 内容如下: map.connect ”,:controller=>”index”,:action=>”index”解决no such file to load — ...

    sql例子:导出/导入数据到exel

    3. 使用LOAD DATA INFILE(MySQL)或BULK INSERT(SQL Server)等命令批量导入数据。这些命令可以直接读取文件,快速将数据插入到数据库中。需要注意的是,文件格式必须符合特定的要求,比如字段分隔符、行结束符等...

    php.ini-development

    Expressions in the INI file are limited to bitwise operators and parentheses: ; | bitwise OR ; ^ bitwise XOR ; & bitwise AND ; ~ bitwise NOT ; ! boolean NOT ; Boolean flags can be turned on using ...

    drupal 6.12

    If you make manual changes to the file later, be sure to protect it again after making your modifications. Failure to remove write permissions to that file is a security risk. Although the default ...

    libmysqlclient.so.18.zip

    PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysql.so' - libmysqlclient.so.18: cannot open shared object file: No such file or directory in Unknown on line 0

    freebsd8.0配置 web

    - 如果遇到 `[warn] (2) No such file or directory: Failed to enable the ‘httpready’ AcceptFilter` 错误,可以手动加载 `accf_http` 模块解决: - 使用 `# kldload accf_http` 加载模块。 - 在 `/boot/...

    UE(官方下载)

    You can use these functions to insert a file into the current file, delete the active file, send the file through email, or insert a string into the file at every specified increment HTML preview ...

    ubuntu下安装ruby on rails

    **问题描述:** 访问自定义页面时出现 `no such file load – sqlite3` 错误。 **解决方案:** Rails 默认使用 SQLite3 作为开发数据库。确保安装了 SQLite3: ```bash sudo apt-get install sqlite3 sudo gem ...

    suipack trial

    Provides SkinBuilder tool to create your own skins, with it which supports to load VisualStyle(*.msstyles) files, you can own thousands of skins now! Supports to create non-rectangular forms and ...

    Centos7 下mysql重新启动MariaDB篇

    2. 错误:Failed to issue method call: Unit mysql.service failed to load: No such file or directory。 解决:这个错误通常意味着系统中没有找到名为'mysql.service'的单元文件。在CentOS 7中,MySQL已经被...

    基于Python的在线网盘系统的设计与实现

    2. **File Upload**: Registered users can upload various types of files, such as documents, images, audio, and video, to their personal cloud storage space. 3. **File Sharing**: The system supports ...

    Centos7安装swoole扩展操作示例

    类似地,如果遇到“fatal error: openssl/ssl.h: No such file or directory”,表明缺少OpenSSL开发库,使用`yum install openssl-devel`进行安装。如果需要HTTP2支持但编译失败,确保安装nghttp2库,可以通过下载...

Global site tag (gtag.js) - Google Analytics