I follow the instructions and everything works fine. The problem is vendor.css, vendor.js, frontend.css, frontend.js are not copied to app/public/assets folder.
However, I am able to run the build successfully by manually copying these files to the desired assets folder. I did this by going through deployment logs which read:
I copied these files to app/public/assets folder explicitly for everything to work fine.
Also, I face 502 error whenever I first deploy the app. For that, I always kill puma process using sudo kill -9 {pid} and then restarting puma server using bundle exec puma -e production -d -b Unix:/home/deploy/{app-name}/shared/tmp/sockets/puma.sock
And then, I restart nginx server.
Following these steps, I am able to deploy everything successfully.
But this is a lot of work. I rather aim to automate everything. I don't want to copy files explicitly and I don't want to restart the puma and nginx server every time. How do I achieve this?
Also, I need to add 'bower': '*' in the package.json file every time before deployment. Any way to automate this?
Last thing: I want to run some rake tasks from local. Currently, I use this command: bundle exec rake {my_rake_task} RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1 on the server machine. Any suggestions?
MacOS High Sierra 10.13.4 (17E202)
Ruby 2.5.0 Rails 5.1.5
npm 6.1.0
ember-cli 3.0.0
ember cli rails 0.10.0 node 9.10.1 "ember-cli-rails-addon": "^0.10.0"
Application server is multi-threaded => puma
config/initializers/ember.rb
:Rails view that renders Ember Application:
EmberCLI-related routes:
mount_ember_app :frontend, to: "/"
I am using Capistrano for deployment on nginx web server and AWS instance. I am following these 2 sources:
http://www.dsolc.com/blogs/8-deploying-rails-app-to-ec2-instance-with-capistrano-using-nginx-and-puma
https://www.youtube.com/watch?v=imdrYD4ooIk&t=150s
I follow the instructions and everything works fine. The problem is vendor.css, vendor.js, frontend.css, frontend.js are not copied to app/public/assets folder.
However, I am able to run the build successfully by manually copying these files to the desired assets folder. I did this by going through deployment logs which read:
I copied these files to
app/public/assets
folder explicitly for everything to work fine.Also, I face 502 error whenever I first deploy the app. For that, I always kill puma process using sudo kill -9 {pid} and then restarting puma server using
bundle exec puma -e production -d -b Unix:/home/deploy/{app-name}/shared/tmp/sockets/puma.sock
And then, I restart nginx server.
Following these steps, I am able to deploy everything successfully.
But this is a lot of work. I rather aim to automate everything. I don't want to copy files explicitly and I don't want to restart the puma and nginx server every time. How do I achieve this?
Also, I need to add
'bower': '*'
in thepackage.json
file every time before deployment. Any way to automate this?Last thing: I want to run some rake tasks from local. Currently, I use this command:
bundle exec rake {my_rake_task} RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1
on the server machine. Any suggestions?