Closed fahmiardhianto closed 8 years ago
It turns out resetting the server solve the problem.
I still having this issues, even when resetting the server, got it to work before, but now no luck! I love the speed of Mina and want to continue to use it for rails deployment.
Here is my deploy file -
require 'mina/bundler' require 'mina/rails' require 'mina/git' require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
set :domain, '162.243.5.47' set :deploy_to, '/var/www/buildsimply' set :repository, 'git@github.com:frgooall/build_simply.git' set :branch, 'master'
set :shared_paths, ['config/database.yml', 'config/secrets.yml', 'log', 'public/uploads']
set :user, 'deploy' # Username in the server to SSH to. set :ssh_options, '-A' task :environment do invoke :'rbenv:load' end
task :setup => :environment do queue! %[mkdir -p "#{deploy_to}/#{shared_path}/log"] queue! %[chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/log"]
queue! %[mkdir -p "#{deploy_to}/#{shared_path}/config"] queue! %[chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/config"]
queue! %[touch "#{deploy_to}/#{shared_path}/config/database.yml"] queue! %[touch "#{deploy_to}/#{shared_path}/config/secrets.yml"] queue %[echo "-----> Be sure to edit '#{deploy_to}/#{shared_path}/config/database.yml' and 'secrets.yml'."]
if repository repo_host = repository.split(%r{@|://}).last.split(%r{:|\/}).first repo_port = /:([0-9]+)/.match(repository) && /:([0-9]+)/.match(repository)[1] || '22'
queue %[
if ! ssh-keygen -H -F #{repo_host} &>/dev/null; then
ssh-keyscan -t rsa -p #{repo_port} -H #{repo_host} >> ~/.ssh/known_hosts
fi
]
end end
desc "Deploys the current version to the server." task :deploy => :environment do to :before_hook do
end deploy do
# instance of your project.
invoke :'git:clone'
invoke :'deploy:link_shared_paths'
invoke :'bundle:install'
invoke :'rails:db_migrate'
invoke :'rails:assets_precompile'
invoke :'deploy:cleanup'
to :launch do
queue "mkdir -p #{deploy_to}/#{current_path}/tmp/"
queue "touch #{deploy_to}/#{current_path}/tmp/restart.txt"
end
end end
One assumption that I strongly believe is that when doing assets precompilation, server use lot of memory and crashed. My VPS memory back then just 512MB and then I upgrade my VPS memory to 1GB. After the upgrade, till today, I only failed once and restarting VPS solve the problem.
@fahmiardhianto Yup, that was the issue! Once I upgraded not having that error. Thanks!
@fahmiardhianto After hours of trying to find javascript errors, you saved me. I was used to receive a "No memory" error during precompilation, not a runtimeerror: 1, pretty bad error description.... Thank you so much
Thank you for the out-of-memory explanation. My cause: I forgot to add the swap file to /etc/fstab.
Use therubyracer gem
Hi, I'm getting this error when trying to deploy my Rails app using mina. I have node v4.4.4 installed and have successfully deployed my app in its previous version, but now I don't know what the problem is. I've tried this solution to edit the runtimes file but no luck. Tried restart the server and app, still got this error. There's suggestion to reinstall node but I don't think that will solve the problem.