0

当我cap [deploy:cold]在部署到亚马逊 ec2 时使用橡胶运行时,我会在控制台上无休止地打印出以下内容。
请帮忙出出主意。我在这里关注了railscast链接 http://railscasts.com/episodes/347-rubber-and-amazon-ec2

servers: ["app01.foo.com"]
  [app01.foo.com] executing command
** [out :: app01.foo.com] .
** [out :: app01.foo.com] .
** [out :: app01.foo.com] .
** [out :: app01.foo.com] .
** [out :: app01.foo.com] .
** [out :: app01.foo.com] .
** [out :: app01.foo.com] .
4

1 回答 1

0

这是一个设置问题。开箱即用的橡胶对我们不起作用。您必须进行一些修改。您遇到的问题的主要修复是在 mysql 配置中:config/rubber/deploy_mysql.rb

@@ -40,7 +40,7 @@
             pass = "identified by '#{env.db_pass}'" if env.db_pass
             rubber.sudo_script "create_master_db", <<-ENDSCRIPT
             mysql -u root -e "create database #{env.db_name};"
-              mysql -u root -e "delete from mysql.user where user='' and host='localhost';"
+              mysql -u root -e "delete from mysql.user where user='';"
           mysql -u root -e "grant all on *.* to '#{env.db_user}'@'%' #{pass};"
           mysql -u root -e "grant select on *.* to '#{env.db_slave_user}'@'%' #{pass};"
           mysql -u root -e "grant replication slave on *.* to '#{env.db_replicator_user}'@'%' #{pass};"

还有将 :asset 角色设置为 :app 让我们长期受阻。这发生在 deploy.rb 并且根据上面的 railscast。

于 2013-05-15T05:46:13.463 回答