rvm

2010-11-28 8 views
31

मैं हाल ही में 3 रेल करने के लिए उन्नत और रेल 3.0.3 साथ एक नया आवेदन बनाया है साथ रेल 3 के लिए Snow Leopard पर mysql2 मणि ​​स्थापित करें, लेकिन मैं एक त्रुटिrvm

 
Macintosh:$ rails server 
=> Booting WEBrick 
=> Rails 3.0.3 application starting in development on http://0.0.0.0:3000 
=> Call with -d to detach 
=> Ctrl-C to shutdown server 
[2010-11-28 11:32:47] INFO WEBrick 1.3.1 
[2010-11-28 11:32:47] INFO ruby 1.8.7 (2010-04-19) [i686-darwin10.4.0] 
[2010-11-28 11:32:47] INFO WEBrick::HTTPServer#start: pid=1055 port=3000 


Started GET "/" for 127.0.0.1 at Sun Nov 28 11:32:52 +0000 2010 

RuntimeError (!!! Missing the mysql2 gem. Add it to your Gemfile: gem 'mysql2'): 


बार आ रही है मैं एक 64 बिट्स है मशीन। त्रुटियां केवल दस्तावेज़ीकरण पर हैं और ऐसा लगता है कि मणि सही ढंग से स्थापित किया गया था।

 
Macintosh:$ env ARCHFLAGS="-arch i386" gem install mysql2 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config 
Building native extensions. This could take a while... 
Successfully installed mysql2-0.2.6 
1 gem installed 
Installing ri documentation for mysql2-0.2.6... 
Enclosing class/module 'mMysql2' for class Client not known 
Building YARD (yri) index for mysql2-0.2.6... 
Installing RDoc documentation for mysql2-0.2.6... 
Enclosing class/module 'mMysql2' for class Client not known 

मैं अपने GemFile में मणि को शामिल किया है

 
source 'http://rubygems.org' 

gem 'rails', '3.0.3' 
gem 'mysql2' 
gem 'sqlite3-ruby', :require => 'sqlite3' 

मेरे GemFile.lock इस

 
GEM 
    remote: http://rubygems.org/ 
    specs: 
    abstract (1.0.0) 
    actionmailer (3.0.3) 
     actionpack (= 3.0.3) 
     mail (~> 2.2.9) 
    actionpack (3.0.3) 
     activemodel (= 3.0.3) 
     activesupport (= 3.0.3) 
     builder (~> 2.1.2) 
     erubis (~> 2.6.6) 
     i18n (~> 0.4) 
     rack (~> 1.2.1) 
     rack-mount (~> 0.6.13) 
     rack-test (~> 0.5.6) 
     tzinfo (~> 0.3.23) 
    activemodel (3.0.3) 
     activesupport (= 3.0.3) 
     builder (~> 2.1.2) 
     i18n (~> 0.4) 
    activerecord (3.0.3) 
     activemodel (= 3.0.3) 
     activesupport (= 3.0.3) 
     arel (~> 2.0.2) 
     tzinfo (~> 0.3.23) 
    activeresource (3.0.3) 
     activemodel (= 3.0.3) 
     activesupport (= 3.0.3) 
    activesupport (3.0.3) 
    arel (2.0.4) 
    builder (2.1.2) 
    erubis (2.6.6) 
     abstract (>= 1.0.0) 
    i18n (0.4.1) 
    mail (2.2.10) 
     activesupport (>= 2.3.6) 
     i18n (~> 0.4.1) 
     mime-types (~> 1.16) 
     treetop (~> 1.4.8) 
    mime-types (1.16) 
    mysql2 (0.2.6) 
    polyglot (0.3.1) 
    rack (1.2.1) 
    rack-mount (0.6.13) 
     rack (>= 1.0.0) 
    rack-test (0.5.6) 
     rack (>= 1.0) 
    rails (3.0.3) 
     actionmailer (= 3.0.3) 
     actionpack (= 3.0.3) 
     activerecord (= 3.0.3) 
     activeresource (= 3.0.3) 
     activesupport (= 3.0.3) 
     bundler (~> 1.0) 
     railties (= 3.0.3) 
    railties (3.0.3) 
     actionpack (= 3.0.3) 
     activesupport (= 3.0.3) 
     rake (>= 0.8.7) 
     thor (~> 0.14.4) 
    rake (0.8.7) 
    sqlite3-ruby (1.2.4) 
    thor (0.14.6) 
    treetop (1.4.9) 
     polyglot (>= 0.3.1) 
    tzinfo (0.3.23) 

PLATFORMS 
    ruby 

DEPENDENCIES 
    mysql2 
    rails (= 3.0.3) 
    sqlite3-ruby 

रत्न सूची की तरह लग रहा

 
Macintosh:$ gem list 

*** LOCAL GEMS *** 

abstract (1.0.0) 
actionmailer (3.0.3) 
actionpack (3.0.3) 
activemodel (3.0.3) 
activerecord (3.0.3) 
activeresource (3.0.3) 
activesupport (3.0.3) 
acts_as_ferret (0.4.4) 
arel (2.0.4) 
builder (3.0.0, 2.1.2) 
bundler (1.0.7) 
capistrano (2.5.9) 
dnssd (1.3) 
erubis (2.6.6) 
fastthread (1.0.7) 
gnuplot (2.2) 
highline (1.6.1, 1.5.1) 
hpricot (0.8.1) 
i18n (0.4.2, 0.4.1) 
libxml-ruby (1.1.3) 
linecache (0.43) 
mail (2.2.10) 
memcache-client (1.8.5, 1.7.6) 
memcached (0.17.5) 
mime-types (1.16) 
mysql2 (0.2.6) 
net-scp (1.0.4, 1.0.2) 
net-sftp (2.0.5, 2.0.2) 
net-ssh (2.0.23, 2.0.15) 
net-ssh-gateway (1.0.1) 
polyglot (0.3.1) 
rack (1.2.1, 1.0.1, 1.0.0) 
rack-mount (0.6.13) 
rack-test (0.5.6) 
rails (3.0.3) 
railties (3.0.3) 
rake (0.8.7, 0.8.4) 
rcov (0.9.9, 0.9.8) 
rdoc (2.5.11) 
RedCloth (4.2.2) 
rmagick (2.12.2) 
ruby-debug-base (0.10.3) 
ruby-debug-ide (0.4.5) 
rubygems-update (1.3.7, 1.3.5, 1.3.3) 
rvm (1.1.1) 
sqlite3-ruby (1.3.2, 1.2.4) 
test-spec (0.10.0) 
text-format (1.0.0) 
text-hyphen (1.0.0) 
thor (0.14.6) 
treetop (1.4.9) 
tzinfo (0.3.23) 
yard (0.5.8) 

मेरे Mysql ऊपर और है चल रहा है:

 
Macintosh:$ mysql -uroot 
Welcome to the MySQL monitor. Commands end with ; or \g. 
Your MySQL connection id is 1 
Server version: 5.1.53 MySQL Community Server (GPL) 

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 
This software comes with ABSOLUTELY NO WARRANTY. This is free software, 
and you are welcome to modify and redistribute it under the GPL v2 license 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 

mysql> 

यह सब मेरे ब्रांड के नए एप्लिकेशन में है, लेकिन मुझे अभी भी लापता mysql2 मणि ​​समस्या मिल रही है।

मेरे पास एक्स कोड 3.2.4 स्थापित के साथ हिम तेंदुए 10.6.5 है।

कोई विचार?

अग्रिम धन्यवाद!

+0

धन्यवाद, यह सिर्फ मुझे ऊपर चला गया। मुझे बहुत समय बचा है, आपके पास है। – richo

उत्तर

89

मैं वास्तव में मेरी database.yml

पर गलत एडाप्टर सेट था तो ठीक

 
development: 
    adapter: mysql2 
    database: development_database 
    username: root 
    password: 

के बजाय

 
adapter: mysql 

रवींद्र है!

+0

मुझे एक ही समस्या थी, ठीक करने के लिए धन्यवाद !!! मूल त्रुटि संदेश मुझे लगता है कि स्पष्ट संभव नहीं था। ;) –

+0

मैंने इसे लगभग 1000 बार मारा है। – ablemike

+0

+1 अहहहाहह मैं कभी-कभी बेवकूफ हूं ... –

5

आप इस हाल ही में देख रहे हैं, तो ऐसा इसलिए mysql2 0.3 ActiveRecord एडाप्टर, जो अब रेल का हिस्सा 3,1

WARNING: This version of mysql2 (0.3.2) doesn't ship with the ActiveRecord adapter bundled anymore as it's now part of Rails 3.1 
WARNING: Please use the 0.2.x releases if you plan on using it in Rails <= 3.0.x 

अपने Gemfile समायोजित तदनुसार अगर आप रेल 3.0.x पर हैं है हटा दिया है

gem 'mysql2', '~> 0.2.6' 
संबंधित मुद्दे