I am deploying a rails app to EC2 using capistrano and it all works fine.
Except that I cannot find a production.log or staging.log file in the shared folder.
I already ran
$ cap deploy:setup
$ cap deploy:check
$ cap deploy
And they both work fine.
When I ssh in my instance the log folder in my_application/current/log is empty
Any idea?
Thanks
Ok I solved it by simply removing all my app on the server and running
cap deploy:setup
My application was owned by the root user and could not write anything in the log file
Related
Previously i had deleted some migration files,which caused missing relations error(while tying to deploy to new server) so to fix that i added back the deleted migration files.I committed and pushed the new changes to gitlab after which i tried cap production deploy and still getting the missing relation error .On checking he release folder in the server i found that newly added back migrations files were not present.How to fix this.
I thought of trying to manually create the files in server,but cap production deploy is creating new release folders each time
how to fix this
I solved this issue by executing the following commands inside server release folder
1)
I ran
RAILS_ENV=production bundle exec rails db:reset DISABLE_DATABASE_ENVIRONMENT_CHECK=1 --trace
2) RAILS_ENV=production bundle exec rails db:setup DISABLE_DATABASE_ENVIRONMENT_CHECK=1
3)After this i executed cap production deploy and it all seems good
Note1: try executing the above commands first without DISABLE_DATABASE_ENVIRONMENT_CHECK=1 --trace if prompted add this command
Note2: In case u had some migration files deleted and currently u are trying to deploy to new server,then even if cap production deploy fails with missing relation error(caused by deleted migrations) you can get inside the latest release folder and run above commands to get the database setup correctly,after which u can try cap production deploy which most probably wont show any issues(related to deleted migration files)
I am deploying a rails app on a AWS ec2 instance through Capistrano.
Cap production deploy:check is successful, but when I am running cap production deploy I get an error.
Can anyone help?
I found the problem. Your Gemfile in the project was named "gemfile" SMALL g
It must be Gemfile.
So the thing run on Mac and Windows. But when you deploy to Linux, it does not see the Gemfile.Please rename the "gemfile" in your project to "Gemfile"
It will work.
I am new to Capistrano and this is my first attempt using it to deploy my rails application. I believe I have my config/deploy.rb setup properly, but before I do
cap production deploy:setup
I want to make sure that no harm will happen to my database. The database for this project is already set and has data in it. I could not figure out if doing
cap production deploy:setup
will destroy my production database and re-create it as an empty DB. Opinions?
cap deploy:setup
When you run this command, Capistrano will SSH to your server, enter
the directory that you specified in the deploy_to variable, and create
a special directory structure that’s required for Capistrano to work
properly. If something is wrong with the permissions or SSH access,
you will get error messages. Look closely at the output Capistrano
gives you while the command is running.
This command will do nothing with your database.
Hi I'm actually trying to deploy discourse on Heroku.
I'm following the step by step guide here Basic Heroku deployment
I'm facing a problem when I try to rake assets:precompile (I'm precompiling locally).
The rake command is aborted, saying to me that
No such file or directory: mydirectories/discourse/config/database.yml
When I rake assets:precompile I'm in production environment (RAILS_ENV=production).
So I checked if the database.yml was missing in the repo, and yes it was.
I currently have two database.yml but a bit different. There's database.yml.development-sample and
database.yml.production-sample.
I tried renaming database.yml.production-sample to a simple database.yml but it still doesn't work giving me this error:
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
What am I doing wrong ?
Cordially,
Rob
PS : The config/redis.yml and public/assets are commented in the .gitignore
# http://shcatula.wordpress.com/2013/07/08/deploying-discourse-to-heroku/ you have a detailed description of deployment of Discourse to Heroku. It also links to a gist with a shell script that does the entire job of pre-compiling and preparing your deploy. The shell script pretty much explains all the steps needed. Hope it helps!
I'm running Rails + Passenger under an Ubuntu AWS's instance. Now I'm trying to deploy with Capistrano, I already did my git repository (and upload it to the server) and my deploy.rb file (with capify .). I already runned cap deploy:setup and cap deploy:check with success. But now when I try to run cap deploy it fail and I get this error http://pastebin.com/uzkerA9F
Well, I found the problem and solution here
Capistrano asks for password when deploying, despite SSH keys
So > I add set :ssh_options, {:forward_agent => true} to my deploy.rb file