Rails 3 with mysql problem

I updated rails 3 on my snow leopard. I used to use sqlite for development. It works fine when I rake db: create.

Now I am trying to install mysql on my mac.

  • I downloaded mysql-5.1.50-osx10.6-x86.dmg
  • Installed all three files. (mysql- {version} -osx10.5-x86.pkg, MySQL.prefPane, MySQLStartupItem.pkg)
  • run this to install gem.
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

Things are good. created without errors.

I am creating a new project with

rails new p1 -d mysql
Run
rake db: create

shows

Could not find gem 'mysql2 (> = 0, runtime)' in any of the gem sources.
Try running `bundle install`.

. sudo gem install mysql2.

.

dyld: lazy symbol binding failed: Symbol not found: _mysql_init
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.3/lib/mysql2/mysql2.bundle
  Expected in: flat namespace

dyld: Symbol not found: _mysql_init
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.3/lib/mysql2/mysql2.bundle
  Expected in: flat namespace

Trace/BPT trap

mysql2.bundle. . .

. .

, 32- mysql ? ? rails 3 gem mysql2, '-d mysql'.

Rails 3 + MySql mac

. .

+3
4

MySQL-5.1.50-osx10.6-x86 MySQL-5.1.50-osx10.6-x86_64

mysql.prefpane dyld: : : _mysql_init.

http://weblog.rubyonrails.org/. ,

MySQL-5.1.50-osx10.5-x86_64

. . errno: 2. .

errno: 2 REBOOT.

+1

Rails mysql2, . wycat blog.

+2
0
source

We struggled with this for about two hours, reinstalled mysql a couple of times, and eventually solved our problem with "rvm implode" and then reinstalling rvm. This removes everything in .rvm, so be careful, but if you use rvm, it's worth it.

0
source

Source: https://habr.com/ru/post/1765269/


All Articles