2013-07-23 101 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

非常感謝你的回覆。 –