Problem with assets and path

34 views
Skip to first unread message

Paul Bergstrom

unread,
Jul 15, 2013, 6:04:02 PM7/15/13
to rubyonra...@googlegroups.com
My page doesn't load css and images in production mode. For css I get a
path like "/appname/assets/...". What's wrong? Should be without
appname.

I tried the config.assets.paths but no luck.

My app runs on fcgi (if that could mean anything) on the production
server. Locally I use passenger and have no problem.

--
Posted via http://www.ruby-forum.com/.

Paul Bergstrom

unread,
Jul 16, 2013, 3:33:36 AM7/16/13
to rubyonra...@googlegroups.com
One more thing. The host has a www directory. When using rails the app
is in another directory with a .htaccess and a RewriteRule in www
pointing to the rails app and dispatch.fcgi. Could it be a problem with
that?

Paul Bergstrom

unread,
Jul 16, 2013, 3:57:31 AM7/16/13
to rubyonra...@googlegroups.com
Additional question.

Should I run "RAILS_ENV=production bundle exec rake assets:precompile"
on the server? Must I do that each time I add a new asset, e g image or
new css file?

Walter Lee Davis

unread,
Jul 16, 2013, 11:18:26 AM7/16/13
to rubyonra...@googlegroups.com
I find that I do have to do this after every change at the server. I don't need to include the environment, it seems to be a default somehow. rake assets:precompile is enough (I do run rvm on the server, so the bundle exec part is inferred as well).

Walter
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/45b2c6abc162a4610e7cea2f1278d323%40ruby-forum.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Paul Bergstrom

unread,
Jul 16, 2013, 11:38:24 AM7/16/13
to rubyonra...@googlegroups.com
Walter Davis wrote in post #1115639:
> I find that I do have to do this after every change at the server. I
> don't need to include the environment, it seems to be a default somehow.
> rake assets:precompile is enough (I do run rvm on the server, so the
> bundle exec part is inferred as well).
>
> Walter

Thank you. Good to know.

Do you know how to solve wrong path for assets? Can I assign where root
is in my environment?

Walter Lee Davis

unread,
Jul 16, 2013, 11:54:17 AM7/16/13
to rubyonra...@googlegroups.com
I don't, and I hope someone else can, for both our sakes!

Walter

>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f5c4205d3924acd400181b9279179abe%40ruby-forum.com.

Kory Tegman

unread,
Jul 16, 2013, 1:54:04 PM7/16/13
to rubyonra...@googlegroups.com

Paul Bergstrom

unread,
Jul 16, 2013, 4:41:31 PM7/16/13
to rubyonra...@googlegroups.com
Not sure the solution is in here but
https://www.altamiracorp.com/blog/employee-posts/rails-3

Didn't work for me. I really need a solution to the path problem :-)
Reply all
Reply to author
Forward
0 new messages