简体   繁体   中英

can't start Rails Server (MySQL Windows)

I can't seem to start a MySQL server using the mysql2 gem

here's my specific Error

D:\Ruby Workspace\sites\simple_cms>rails s
C:/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': cannot load such file -- mysql2/2.2/mysql2 (LoadError)
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/lib/mysql2.rb:31:in `require'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x86-mingw32/lib/mysql2.rb:31:in `<top (required)>'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:76:in `require'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:72:in `each'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:72:in `block in require'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:61:in `each'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler/runtime.rb:61:in `require'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/bundler-1.10.3/lib/bundler.rb:134:in `require'
    from D:/Ruby Workspace/sites/simple_cms/config/application.rb:7:in `<top (required)>'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `require'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:78:in `block in server'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

I've placed the libmysql.dll in my Ruby bin folder with no luck as well

I tried pointing to my MySQL server 5.6\\lib and include folders and had no luck

I think the main problem here is: 'require': cannot load such file -- mysql2/2.2/mysql2

but I'm unsure on how to remedy this as pointing towards the MySQL server 5.6 didn't work and neither did the mySQL connector.

Ended up using railsFTW , seems like the most up to date versions aren't compatible with one another.

railsFTW is a windows package installer of everything you need to get started with rails.

'edit' I've also ran across browser based IDE's that ignore what system you are running. I would recommend cloud9's IDE over any local install for rails to windows any day.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM