Create a new Ruby on Rails application using MySQL instead of SQLite

前端 未结 19 1339
难免孤独
难免孤独 2020-12-04 05:46

I want to create my Rails application with MySQL, because I like it so much. How can I do that in the latest version of Rails instead of the default SQLite?

19条回答
  •  孤街浪徒
    2020-12-04 06:17

    First make sure that mysql gem is installed, if not? than type following command in your console

    gem install mysql2
    

    Than create new rails app and set mysql database as default database by typing following command in your console

    rails new app-name -d mysql
    

提交回复
热议问题