App running locally, but getting a "something went wrong" error on server

1,162 views
Skip to first unread message

EastSideDev

unread,
May 17, 2012, 10:35:33 AM5/17/12
to Phusion Passenger Discussions
Server setup: Centos 6.2, ruby-1.9.3-p125, Rails 3.2.3, Passenger
Local setup: MAC, ruby-1.9.3-p125, Rails 3.2.3

I use Rubymine as my development IDE, and when I uploaded the
application, I verified that the files were uploaded to the right
directories on the server, and that httpd.conf is configured properly
for passenger:
<VirtualHost *:80>
ServerName dev.myappserver.com
DocumentRoot /home/dev/public
<Directory /home/dev/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>

When I do: http://dev.myappserver.com
I get the error message: We're sorry, but something went wrong

Locally, it runs fine (rails s, and then http://localhost:3000)
Also, no log file is generated on the server.
Any ideas? I am real new to Rails and Ruby

Hongli Lai

unread,
May 17, 2012, 10:49:04 AM5/17/12
to phusion-...@googlegroups.com

When something goes wrong, always check the following log files:
The apache global error log file. The global one, not the per-vhost one.
The rails app log file.

There should be more error information in one of those places.

Sent from my Android phone.

Op 17 mei 2012 16:40 schreef "EastSideDev" <easts...@gmail.com> het volgende:
--
You received this message because you are subscribed to the Google Groups "Phusion Passenger Discussions" group.
To post to this group, send email to phusion-...@googlegroups.com.
To unsubscribe from this group, send email to phusion-passen...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/phusion-passenger?hl=en.

EastSideDev

unread,
May 17, 2012, 3:26:05 PM5/17/12
to Phusion Passenger Discussions
I looked into the apache error log, and here's what it said:

ActionView::Template::Error (application.css isn't precompiled):
2: <html>
3: <head>
4: <title><%= title %></title>
5: <%= stylesheet_link_tag "application", media: 'all' %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: <%= render 'layouts/shim' %>
app/views/layouts/application.html.erb:5:in
`_app_views_layouts_application_html_erb__1896008356434155007_26705700'


On May 17, 7:49 am, Hongli Lai <hongli...@gmail.com> wrote:
> When something goes wrong, always check the following log files:
> The apache global error log file. The global one, not the per-vhost one.
> The rails app log file.
>
> There should be more error information in one of those places.
>
> Sent from my Android phone.
> Op 17 mei 2012 16:40 schreef "EastSideDev" <eastside...@gmail.com> het
> volgende:
>
>
>
>
>
>
>
> > Server setup: Centos 6.2, ruby-1.9.3-p125, Rails 3.2.3, Passenger
> > Local setup: MAC, ruby-1.9.3-p125, Rails 3.2.3
>
> > I use Rubymine as my development IDE, and when I uploaded the
> > application, I verified that the files were uploaded to the right
> > directories on the server, and that httpd.conf is configured properly
> > for passenger:
> > <VirtualHost *:80>
> >    ServerName dev.myappserver.com
> >    DocumentRoot /home/dev/public
> >    <Directory /home/dev/public>
> >        Allow from all
> >        Options -MultiViews
> >    </Directory>
> > </VirtualHost>
>
> > When I do:http://dev.myappserver.com
> > I get the error message: We're sorry, but something went wrong
>
> > Locally, it runs fine (rails s, and thenhttp://localhost:3000)

Phillip Koebbe

unread,
May 17, 2012, 7:09:06 PM5/17/12
to phusion-...@googlegroups.com

On May 17, 2012, at 2:26 PM, EastSideDev wrote:

> I looked into the apache error log, and here's what it said:
>
> ActionView::Template::Error (application.css isn't precompiled):
> 2: <html>
> 3: <head>
> 4: <title><%= title %></title>
> 5: <%= stylesheet_link_tag "application", media: 'all' %>
> 6: <%= javascript_include_tag "application" %>
> 7: <%= csrf_meta_tags %>
> 8: <%= render 'layouts/shim' %>
> app/views/layouts/application.html.erb:5:in
> `_app_views_layouts_application_html_erb__1896008356434155007_26705700'
>
>

When using the asset pipeline, which is default in Rails 3.2, you have to precompile assets in production. One way is to use Capistrano for deployment and have

run "cd #{deploy_to}/current; rake assets:precompile RAILS_ENV=#{rails_env}"

as one of the latter steps of deployment. If you are not using Capistrano (which I don't think you are), you'll need to cd into your project directory (on the server) and issue

rake assets:precompile RAILS_ENV=production

and that particular error should go away. Do keep in mind you'll have to do this after every deployment, which is why something like Capistrano is helpful.

Phillip

EastSideDev

unread,
May 17, 2012, 4:23:41 PM5/17/12
to Phusion Passenger Discussions
The solution was to pre-compile on the server (I thought that
Passenger handled these deployment issues):

rake assets:precompile

and then restart the Apache server

Phillip Koebbe

unread,
May 17, 2012, 9:15:17 PM5/17/12
to phusion-...@googlegroups.com

On May 17, 2012, at 3:23 PM, EastSideDev wrote:

> The solution was to pre-compile on the server (I thought that
> Passenger handled these deployment issues):
>
> rake assets:precompile
>
> and then restart the Apache server
>


Passenger is an app server not a deployment tool. If you want something to automate deployment tasks, look into Capistrano.

Phillip

Reply all
Reply to author
Forward
0 new messages