最近新起一个项目,使用Mina
进行发布,在第一次发布时,总是报如下错误:
-----> Migrating database
Rails Error: Unable to access log file. Please ensure that /home/dgg/newp/tmp/build-13941793351724/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
-----> Precompiling asset files
Rails Error: Unable to access log file. Please ensure that /home/dgg/newp/tmp/build-13941793351724/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
rake aborted!
File exists - /home/dgg/newp/tmp/build-13941793351724/tmp
/home/dgg/newp/tmp/build-13941793351724/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/cache/file_store.rb:162:in `ensure_cache_path'
/home/dgg/newp/tmp/build-13941793351724/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/cache/file_store.rb:91:in `write_entry'
/home/dgg/newp/tmp/build-13941793351724/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/cache/strategy/local_cache.rb:140:in `write_entry'
/home/dgg/newp/tmp/build-13941793351724/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/cache.rb:364:in `block in write'
/home/dgg/newp/tmp/build-13941793351724/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/cache.rb:520:in `instrument'
/home/dgg/newp/tmp/build-13941793351724/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/cache.rb:362:in `write'
/home/dgg/newp/tmp/build-13941793351724/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/caching.rb:90:in `cache_set'
/home/dgg/newp/tmp/build-13941793351724/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/caching.rb:53:in `cache_set_hash'
Mina
发布脚本如下:require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm'
namespace :env do
task :ss => [:environment] do
set :domain, '192.168.0.1'
set :branch, 'develop'
set :deploy_server, 'ss'
end
end
set :deploy_to, '/home/dgg/newp'
set :app_path, "#{deploy_to}/#{current_path}"
set :repository, 'git@[My_Git_Repon]'
set :shared_paths, ['tmp', 'log', 'config/database.yml', 'config/application.yml', 'public/uploads']
set :user, 'dgg'
set :server, ENV['to'] || default_server
invoke :"env:#{server}"
task :environment do
invoke :'rvm:use[1.9.3]'
end
task :deploy => :environment do
deploy do
invoke :'git:clone'
invoke :'deploy:link_shared_paths'
invoke :'bundle:install'
invoke :'rails:db_migrate'
invoke :'rails:assets_precompile'
end
end
我使用chmod 666 /home/dgg/newp/tmp/ -R
赋予相应的权限,但是还是报这个错误。在 StackOverflow 上查了一下,一些解答的目录貌似固定目录。对于我的这种情况不适用。
请问:这个问题怎么破?求指点,求解答。谢谢!