Pergunta

I'm a complete novice when it comes to deploying a site, please excuse the vagueness of this question.

I have followed ryan bates episode episode #337 (https://github.com/railscasts/337-capistrano-recipes) to deploy my rails application. I am using ubuntu 10.04 lts, nginx, unicorn and capistrano with postgres.

after cap deploy: cold everything seems to build fine.

But when I hit my ip, my rails application gives me this error:

We're sorry, but something went wrong.

I know it's not a very helpful error message. I assume it has to do with the database because I've seen it before when deploying on heroku with postgresql.

I do not know how to check my log files on linode server and get more information on how to debug this.

any guidance is much appreciated.

Thank you all in advance.

Foi útil?

Solução

I had a similar issue deploying a Rails app on OpenShift.

In my case the error was generated by missing assets, not defined in the manifest files.

It turns out that it has to do something with assets. I started digging on it I found that it is generated when Rails can't find the assets you are looking for because of either they are missing or they are not compiled or they are are not included in a manifest (directly by name or indirectly via require_tree).

The first case is clear. You should include them in your app's code or you should add them to your gear. The second case shouldn't be a problem for you, because OpenShift does that for you. But if you do have a problem with that, search the forum for issues regarding not compiling your assets.

The third case has two solutions. There is a right one and quick one. I'll need an expert's opinion about the second one. Here they are: You need to add the asset (usually a stylesheet and/or some third-party tool) to the list of items to precompile in the environment application.rb.

config.assets.precompile += ['960sm.css']

Or the quick way I found, which will work universally for all your assets: There is a setting in the config/environments/production.rb

config.assets.compile = true

Set it to true like that and this should solve the problem.

I hope this helps. I spent two weeks digging on the same problem.

Outras dicas

You'll need to log into your linode server with ssh and look at the log files yourself.

This line from the config/deploy.rb file in the Railscast:

set :deploy_to, "/home/#{user}/apps/#{application}"

tells you which directory on the linode server your app was deployed to. In that directory, you should see a directory named shared/log; your logs should be in there.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top