I was deploying my code in openshift rails but it did not take the assets properly.
It’s neither loading the javascripts nor the images.
How to make it work?
I was deploying my code in openshift rails but it did not take the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The first thing you will want to check is if the assets exist on your application. This script is run before the
build.shscript (mentioned next). It attempts to create a symlink for yourpublic/assetsfolder (here is the reasoning behind this). Even if you had that directory, theraketask would still work; the assets would just be wiped every push.Your assets should be compiling whenever you push to your git repository. This is taken care of by this script in the Ruby 1.9 cartridge (this is run by the service and you have no control over it). As you can see, it will run
bundle exec rake assets:precompileas long as you have a Gemfile (which should be the case for all Rails apps).With all that being said, the first thing you should do is check your
.openshift/action_hooksto make sure you are not running anything that might be overwriting yourpublic/assetsdirectory. You can compare them against the ones here.The next thing you should do is actually check the directory on your OpenShift host. You can do this by SSHing into your app (instructions are here). Then check your
public/assetsdirectory. Note: Some of the output has been shortened with.....If that directory is empty, maybe there is a problem with compiling the assets. You should pay attention to the output when you
git pushand see if there is any indication that it is failing (you may want to capture the output usingteelike:git push 2>&1 | tee git_push.log). If there are assets in the directory, check your logs by following these steps.If you’re still having problems, swing by our IRC channel and somebody should be able to help in person.