asset-pipeline

Ruby on Rails assets not being precompiled on Heroku

吃可爱长大的小学妹 提交于 2019-12-11 11:21:32
问题 I have a project that works in the local development environment but breaks when it is uploaded to Heroku. When visiting my project on Heroku, I notice that I get 404 responses from the server saying that it could not find my css and js files. I have done some searching and found out that Heroku is not precompiling my assets. The project will work fine until Heroku puts my project to sleep. Upon waking the project in Heroku, the css and js are broken. The project is using Rails 4.2.4, I have

Why do I get “no route matches” for requests to the asset pipeline?

南楼画角 提交于 2019-12-11 10:35:20
问题 I'm working on upgrading an app to use Rails 3.1 and I'm trying to use the asset pipeline. As a test, I've added foobar.js to app/assets/javascripts . The Setup In application.rb , I've added config.assets.enabled = true . Going on this guide, I think that's all I have to do. Checking it out If I load the console and check Rails.application.config.assets.paths , I do see app/assets/javascripts in the load path. Also, if I check MyAppName::Application.assets , I get back a Sprockets:

asset pipeline error but config.assets.enabled = false in application.rb

£可爱£侵袭症+ 提交于 2019-12-11 10:26:29
问题 I am deploying a first rails app via capistrano with: rails 3.1 passenger 3.0.11 nginx 1.0.10 The app errors out. In my $app/logs/production.log, I get: 5: <%= stylesheet_link_tag "application" %> 6: <%= javascript_include_tag "application" %> 7: <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> 8: <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.js"></script> app/views/layouts/application.html.erb

heroku coffee-rails failure in asset precompile

☆樱花仙子☆ 提交于 2019-12-11 09:47:18
问题 Deploying Rails 3.2.14, Ruby 2.0.0 to heroku git push heroku master Counting objects: 15, done. Delta compression using up to 8 threads. Compressing objects: 100% (9/9), done. Writing objects: 100% (9/9), 895 bytes, done. Total 9 (delta 7), reused 0 (delta 0) -----> Ruby/Rails app detected -----> Using Ruby version: ruby-2.0.0 -----> Installing dependencies using Bundler version 1.3.2 Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -

Images not showing after deployment with Passenger/Capistrano to Nginx server

霸气de小男生 提交于 2019-12-11 08:52:34
问题 Hi I'm deploying my first Rails app to Ubuntu 16 server using Capistrano everything went smooth except the images are not showing in the production environment. On the production server the images are located in this path : /myapp/current/public/assets But if I look at this in the browser my broken images links gives me this(see picture), this is a broken link for the header image. the strange thing is that there is a .svg file in the /myapp/current/public/assets which is showing up perfectly

Asset pipeline not working in rails production environment

一个人想着一个人 提交于 2019-12-11 08:31:59
问题 I'm having an issue deploying to a VPS using Rails. My app works fine in the development environment, but when I push to production using Capistrano, I run into issues. I am using unicorn, rails 3.2.13, and ruby 1.9.3 The issue I have is when I visit my production site, I get a 'template is missing' error: Template is missing Missing template site/index with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :haml]}. Searched in: * "/home/deployer/apps/my-app/releases

Rails 3.2 Asset Pipeline with Passenger Endless Errors

☆樱花仙子☆ 提交于 2019-12-11 08:22:59
问题 Having recently migrated my app to 3.2.1, it would seem I'm another developer struggling with the asset pipeline. Everything looks ok, my assets are compiled and apparently served. In the source of my doc I can see this: <link href="/assets/application-4fac522109a7afaaa2f18ef9f1294e19.css" media="screen" rel="stylesheet" type="text/css" /> And the link works just fine. However, neither my js or css actually load. The only error I can actually see in the apache logs is this: cache: [GET /]

404 when displaying background image in CSS with rails 3.2

青春壹個敷衍的年華 提交于 2019-12-11 06:17:37
问题 I manually added assets/images directory in a rails 3.2 app and added the image background.png . When referring to the image from css background: url("assets/background.png") no-repeat; I am getting a 404 , however assets/stylesheets and assets/javascripts are showing up. **UPDATE it appears as if I revert back to explicitly calling the stylesheet ie <%=stylesheet_link_tag "home.css"%> instead of <%=stylesheet_link_tag "application" %> The background image reders correctly 回答1: That url is

rack-zippy and option -d in production env doesn't serve static assets

我们两清 提交于 2019-12-11 06:15:56
问题 I've a really weird problem here. I'm using the rack-zippy gem in my rails application and if I start it in development environment without pre-compiled assets it works like a charm. With the -d param and without. In production mode (same machine, same project, same directory, same gems) it works too. But if I start it with the -d param ( bundle exec rails server -d ) to daemonize the server, the pre-compiled assets will not be served. Can reproduce that with thin and webrick but NOT with

Precompile assets with same digest on different hosts

老子叫甜甜 提交于 2019-12-11 03:33:37
问题 Is it possible to compile assets on different hosts (traffic routing) with the same digest? For example, if my Rails 3.2 app is deployed to 2 different hosts host1 and host2, I want to have application.css on both host1 and host2 with the same digest application-34a9sadas1238023a8.css 回答1: The digest is going to be the same for each host because it is based on the content of the file. If you are deploying to multiple hosts, the assets will get precompiled on both during deployment. If you