Forum: Ruby on Rails Rails and MySQL

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
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
This topic is locked and can not be replied to.