asset-pipeline

Rails 3.1 and Asset Pipeline: Trouble on deploying with Capistrano

主宰稳场 提交于 2019-12-07 08:44:05
问题 I just switched from Ruby on Rails 3.0.10 to 3.1.0 and I would like to deploy my asset files by using the Capistrano gem (my local machine is a MacOs running Snow Leopard, my remote machine is running Ubuntu 10.04 Lucid). So, as wrote in the Official Guide, I uncomment the load 'deploy/assets' in my Capfile like this: # Uncomment if you are using Rails' asset pipeline load 'deploy/assets' Now, when I run the cap deploy command I get the following error (the error is explained at the bottom):

Capistrano deploy - assets precompile error

ⅰ亾dé卋堺 提交于 2019-12-07 06:44:49
问题 I am deploying with Capistrano to my new VPS. After the first deploy(cap deploy) everything was OK (site was running), but the second deploy failed on assets:precompile error. I am running rails 3.2.13, ruby 2.0.0, rvm. error: * executing "cd -- /home/rails/releases/20140116121250 && RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile" servers: ["IP"] [IP] executing command *** [err :: IP] bash: line 1: 23406 Killed RAILS_ENV=production RAILS_GROUPS=assets bundle exec

How to load css.erb files through asset pipeline

血红的双手。 提交于 2019-12-07 03:01:28
问题 I want my stylesheet to stay plain css but I want to use embedded ruby to include some dynamic paths to images: .home {background: #FFF url(<%= image_path 'hippopotamus.jpg' %>) no-repeat; } If I change the stylesheet from .css to .css.erb the image_path gets interpreted correctly, but it doesn't got processed by the asset pipeline when I deploy to production. If I hard code the path in, it will be wrong either in production or development because they load assets differently. How do I

How can I specify an alternative directory for my HandlebarsJS templates with the ember-rails gem?

佐手、 提交于 2019-12-07 02:30:21
问题 I have a Rails application, and I'm using Ember on the front-end. I'd like to move the ember-related files down one level in the directory structure, but when I do, the templates no longer render. In the plain, vanilla, working version of the application, my directory structure is: ./app/ assets/ javascripts application.js ember-app.js routes.js store.js models/ controllers/ routes/ templates/ views/ with: application.js //= require jquery //= require jquery_ujs //= require handlebars //=

What is the convention in Rails (with asset pipeline) for internationalization inside CSS?

孤街浪徒 提交于 2019-12-07 01:53:57
问题 I know CSS isn't supposed to have content, but it does, like this nice box (below) extracted from the Twitter Bootstrap documentation CSS: /* Echo out a label for the example */ .bs-docs-example:after { content: "Example"; } I don't care for "Example", I use something like that as a mixin: .box (@legend) { /* Echo out a label for the example */ &:after { content: @legend; } } Then I don't need really dynamic CSS, I can easily include the mixin in a class, but instead of passing "Observation"

Tried several fixes: Heroku/Rails 4 Assets Precompile Error

被刻印的时光 ゝ 提交于 2019-12-07 01:04:35
问题 Looks like this is a common issue, so let me begin by saying I've done a lot of research already. Following this thread, I ran heroku labs:enable user-env-compile -a myapp Then I made sure that assets precompile locally by running RAILS_ENV=production bundle exec rake assets:precompile They do. I also followed this tip, setting config.assets.initialize_on_precompile = false in my config/production.rb and config/application.rb. Also, following this issue, I've made sure I have the heroku gems

Point Sprockets' `depend_on` directive to a non-assets file

拈花ヽ惹草 提交于 2019-12-07 00:50:02
问题 I have an app/assets/javascripts/moufa.js.erb file that gets populated with values from a config/moufa.yml file. I want to use the depend_on sprockets directive so that every time the yaml file gets changed, it recompiles the js file. 回答1: We were able to solve this by adding a new directive. This directive (put this in config/initializers/sprockets.rb) adds a dependency on a file in the config/ directory: class Sprockets::DirectiveProcessor def process_depend_on_config_directive(file) path =

Turbolinks and Controller-specific assets

半世苍凉 提交于 2019-12-07 00:40:16
问题 I've modified application.html.erb to use controller specific assets: application.html.erb : <!DOCTYPE html> <html> <head> <title>My Application</title> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= stylesheet_link_tag params[:controller], 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= javascript_include_tag params[:controller], 'data-turbolinks-track' => true %> <%= csrf_meta

Heroku / Ruby-on-Rails error: image not precompiling

你离开我真会死。 提交于 2019-12-07 00:08:09
问题 I know that Heroku is running the rake assets:precompile task: -----> Writing config/database.yml to read from DATABASE_URL -----> Preparing app for Rails asset pipeline Running: rake assets:precompile -----> Rails plugin injection Injecting rails_log_stdout Injecting rails3_serve_static_assets -----> Discovering process types Procfile declares types -> (none) Default types for Ruby/Rails -> console, rake, web, worker -----> Compiled slug size is 17.7MB -----> Launching... done And I told it

Jasmine won't load javascript files from asset pipeline

你。 提交于 2019-12-06 23:53:43
问题 I'm developing a gem and I've installed Jasmine https://github.com/pivotal/jasmine-gem/ All of my required JS files are in my manifest file at app/assets/javascripts/application.js //= require underscore //= require backbone //= require_tree .//vendor //= require_tree .//custom //= require_tree .//templates //= require_tree .//models //= require_tree .//collections //= require_tree .//views And my jasmine.yml file references that: src_files: - 'app/assets/javascripts/application.js' But none