Forum: Ruby on Rails Rails and MySQL

Ad4fa6771d929811050ff55e822cff1f?d=identicon&s=25 Oliver David (Guest)
on 2013-07-13 07:41
(Received via mailing list)
I'm trying to use MySQL instead of SQLite3.  I have MySQL installed on
my
pc.  Do I need to ran something in the ruby to use MySQL?




C:\>rails new MySQLRestaurant --database=mysql

C:\>cd MySQLRestaurant

C:\MySQLRestaurant>rails generate scaffold review poster:string
date:datetime ar
ticle:text
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/l
ib/mysql2/mysql2.rb:2:in `require': 126: The specified module could not
be
found
.   -
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-min
gw32/lib/mysql2/1.9/mysql2.so (LoadError)
        from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-
x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
        from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-
x86-mingw32/lib/mysql2.rb:9:in `require'
        from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-
x86-mingw32/lib/mysql2.rb:9:in `<top (required)>'
        from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/runtime.rb:72:in `require'
        from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/runtime.rb:72:in `block (2 levels) in require'
        from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/runtime.rb:70:in `each'
        from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/runtime.rb:70:in `block in require'
        from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/runtime.rb:59:in `each'
        from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler/runtime.rb:59:in `require'
        from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.3.4/
lib/bundler.rb:132:in `require'
        from C:/MySQLRestaurant/config/application.rb:7:in `<top
(required)>'
        from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0
/lib/rails/commands.rb:44:in `require'
        from
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0
/lib/rails/commands.rb:44:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

C:\MySQLRestaurant>
Bf739e2caa630cd8c97289ad9b8e7b2f?d=identicon&s=25 Balazs Varga (Guest)
on 2013-07-14 09:20
(Received via mailing list)
Hi,

did you ran bundle install?
Make sure that your Gemfile contains the line
gem 'mysql'

Balo
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.