简体   繁体   English

指定默认的Rails数据库

[英]Specify default Rails database

I created a new Rails project by typing the following in CMD of Windows 7: rails new simple_cms –d sql , and I got the error: 我在Windows 7的CMD中键入以下内容创建了一个新的Rails项目: rails new simple_cms –d sql ,我得到了错误:

Invalid value for –database option. -database选项的值无效。 Supported for preconfiguration are: mysql, oracle, postgresql, sqlite3, frontbase, ibm_db, sqlserver, jdbcmysql, jdbcsqlite3, jdbcpostgresql, jdbc. 支持预配置的有:mysql,oracle,postgresql,sqlite3,frontbase,ibm_db,sqlserver,jdbcmysql,jdbcsqlite3,jdbcpostgresql,jdbc。

However, if I type rails new simple_cms –d sqlserver , then I look in the gemfile , I see the entry 但是,如果我键入rails new simple_cms –d sqlserver ,那么我查看gemfile ,我看到了条目

gem 'sqlite3' 宝石'sqlite3'

so why does rails disregard my given option for the default database to use (should be Sql Server)?? 那么为什么rails忽略我的默认数据库使用的给定选项(应该是Sql Server)? Isn't this strange? 这不奇怪吗?

rails new simple_cms -d sqlserver

Works for me. 适合我。 I think you have some other weird character in place of - (in -d option) 我认为你有一些其他奇怪的角色代替- (在-d选项中)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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