2013-07-23 64 views
2

我在开发中构建了一个带有sqlite3的Rails应用程序。现在我想用mysql2部署到rackspace,我想知道我需要哪些更改。我不想将任何数据从开发转移到生产环境。我的database.yml文件看起来是这样的:开发Sqlite3和生产mysql2

# SQLite version 3.x 
# gem install sqlite3 
# 
# Ensure the SQLite 3 gem is defined in your Gemfile 
# gem 'sqlite3' 
development: 
    adapter: sqlite3 
    database: db/development.sqlite3 
    pool: 5 
    timeout: 5000 

# Warning: The database defined as "test" will be erased and 
# re-generated from your development database when you run "rake". 
# Do not set this db to the same as development or production. 
test: 
    adapter: sqlite3 
    database: db/test.sqlite3 
    pool: 5 
    timeout: 5000 

production: 
    adapter: sqlite3 
    database: db/production.sqlite3 
    pool: 5 
    timeout: 5000 

能否请你告诉我,我需要什么样的变化在这个文件中,做我需要做什么?

+0

建议通过自己的经验:避免使用用于生产和开发不同的环境... http://stackoverflow.com/questions/11249059/generic-ruby-solution-for-sqlite3-like-or-postgresql-ilike – gabrielhilal

回答

1

你会希望你的生产数据库看起来是这样的:

production: 
    adapter: mysql2 
    encoding: utf8 
    database: name-of-your-mysql2-database-here 
    pool: 5 
    username: root 
    password: your_password 
+0

非常感谢你的回复。 –