Re: [Rails] Assets not loading in production

2013-10-14 Thread Fahad Idrees
you should try this command rake assets:precompile RAILS_ENV=development


On Sat, Oct 12, 2013 at 7:45 PM, Phillip phil...@gmail.com wrote:

 Hello,

 (Rails 4, Ruby 2)

 I am trying to deploy my first rails app in a production environment, but
 cannot get the assets to load. The site is hosted on Webfaction, they
 advise to create a static app to serve the assets which I have done. But
 I don't understand how my rails app then knows about the static app.

 At the moment, in production inside the head it prints out...

 /stylesheets/application.css
 /javascripts/application.js

 But I want it to be /assets/stylesheets/application.css.

 Any help or advise would be most welcome.

  --
 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-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/rubyonrails-talk/1d480a40-e9d2-47b6-9d96-7215aa1ab0f5%40googlegroups.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAJgx-dhe33QHaqUwv3zphznGSZBFS0iP-Abw0yOHpnNYoOaF7A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Assets not loading in production

2013-10-12 Thread Phillip
Hello,

(Rails 4, Ruby 2)

I am trying to deploy my first rails app in a production environment, but 
cannot get the assets to load. The site is hosted on Webfaction, they 
advise to create a static app to serve the assets which I have done. But 
I don't understand how my rails app then knows about the static app.

At the moment, in production inside the head it prints out...

/stylesheets/application.css
/javascripts/application.js

But I want it to be /assets/stylesheets/application.css.

Any help or advise would be most welcome.

-- 
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-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/1d480a40-e9d2-47b6-9d96-7215aa1ab0f5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] Assets not loading in production

2013-10-12 Thread Jordon Bedwell
On Sat, Oct 12, 2013 at 9:45 AM, Phillip phil...@gmail.com wrote:
 I am trying to deploy my first rails app in a production environment, but
 cannot get the assets to load. The site is hosted on Webfaction, they advise
 to create a static app to serve the assets which I have done. But I don't
 understand how my rails app then knows about the static app.

I don't even want to know what they are talking about or implying
because it sounds wrong. By default in production on a Rails 4
application it prefers you to pass asset serving up higher in the
chain because it will be much quicker for nginx/apache to serve the
app than it will be for Rails to serve it especially considering you
have to proxy to rails who then has to send it back and then it gets
served.

This means that when you build a new app you need to make sure you
have a proper root set (or a sub-domain) that can lead to the public
folder and each time you deploy you need to do `rake
assets:precompile` to get your assets to work.  If you do not wish
this to be the case then set your production.rb to serve static assets
and go on about your way as you will not need to have nginx/apache
care about it.

At that point your Rails application will know the asset path and you
will have access to public/assets/$(name)-$(hash).$(ext).

-- 
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-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAM5XQnyQH3Hg9DqH2pewtGNSbJxU-Wwr9h7LVZfjjBpSYXY0wQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] Assets not loading in production

2013-10-12 Thread Phillip
Thanks Jordon, that's giving me a few things to go on. (Off to 
investigate...)

On Saturday, October 12, 2013 4:15:18 PM UTC+1, Jordon Bedwell wrote:

 On Sat, Oct 12, 2013 at 9:45 AM, Phillip phi...@gmail.com javascript: 
 wrote: 
  I am trying to deploy my first rails app in a production environment, 
 but 
  cannot get the assets to load. The site is hosted on Webfaction, they 
 advise 
  to create a static app to serve the assets which I have done. But I 
 don't 
  understand how my rails app then knows about the static app. 

 I don't even want to know what they are talking about or implying 
 because it sounds wrong. By default in production on a Rails 4 
 application it prefers you to pass asset serving up higher in the 
 chain because it will be much quicker for nginx/apache to serve the 
 app than it will be for Rails to serve it especially considering you 
 have to proxy to rails who then has to send it back and then it gets 
 served. 

 This means that when you build a new app you need to make sure you 
 have a proper root set (or a sub-domain) that can lead to the public 
 folder and each time you deploy you need to do `rake 
 assets:precompile` to get your assets to work.  If you do not wish 
 this to be the case then set your production.rb to serve static assets 
 and go on about your way as you will not need to have nginx/apache 
 care about it. 

 At that point your Rails application will know the asset path and you 
 will have access to public/assets/$(name)-$(hash).$(ext). 


-- 
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-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/f4e7f260-ec2c-4932-93f7-9ee8d4f5eed0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.