I am writing a template for Rails 3 (you can find it here), and I m having troubles with the following lines:
# 8. config/database.yml modifications
if yes?("Do you want to set the database host to /var/run/postgresql ?")
inject_into_file "config/database.yml", " host: /var/run/postgresql
", :after => "development:
"
# FIXME these two won t work :(((( why????
# inject_into_file "config/database.yml", " host: /var/run/postgresql
", :after => "production:
"
# inject_into_file "config/database.yml", " host: /var/run/postgresql
", :after => "test:
"
# Not finding other solutions, I rewrite the two blocks above with two seds
run %q(sed -i /test:/a host: /var/run/postgresql config/database.yml)
run %q(sed -i /production:/a host: /var/run/postgresql config/database.yml)
end
也就是说,第一个投放者——书本作品,以及汇/数据库。 页: 1 我
development:
host: /var/run/postgresql
但是,其他两种注射器——纸面成功应用,但不会修改汇/数据库。 因此,我
test:
adapter: postgresql
and
production:
adapter: postgresql