Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7738059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:09:50+00:00 2026-06-01T08:09:50+00:00

After installing the Resque gem and running a worker my app now produces an

  • 0

After installing the Resque gem and running a worker my app now produces an asset pipeline error:

Sass:SyntaxError: File to import not found or unreadable

I created a fresh branch and narrowed the problem down to running the Resque worker. I’ve only changed three files. Here are the steps to reproduce:

1) Add the Resque gem to Gemfile:

gem 'resque'

2) Create a Resque rake task:

# lib/resque.rake

require 'resque/tasks'

task "resque:setup" => :environment do
    ENV['QUEUE'] = '*'
    Resque.before_fork = Proc.new { ActiveRecord::Base.establish_connection }
end

3) Add a worker to the Procfile:

web: bundle exec rails server -p $PORT thin
worker: bundle exec rake resque:work

I have a feeling that the problem is that the worker is trying to load all my assets. Which I don’t want because its just a background process. I’m not even running the Resque front end so the problem is unrelated to that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:09:52+00:00Added an answer on June 1, 2026 at 8:09 am

    The culprit was actually in my Resque initializer:

    if Rails.env.staging? || Rails.env.production?
      uri = URI.parse ENV['REDISTOGO_URL']
      Resque.redis = Redis.new :host => uri.host, :port => uri.port, :password => uri.password
    end
    

    Heroku runs assets:precompile during slug compilation. During the precompile the environment is loaded, but Heroku does not pass in the ENV vars. The URI parse line was failing due to

    ENV['REDISTOGO_URL'] 
    

    being nil. This caused the assets:precompile rake task to fail.

    The solution is to add:

    config.assets.initialize_on_precompile = false 
    

    to your application.rb file.

    This is available as of Rails 3.1.1 and when set to false the environment will no longer be loaded when compiling the assets. This is a safe choice most of the times.

    Thanks Neil for pointing me in the right direction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After installing rvm, updating .gmrc file, updating rubygems and running gem install rails -v
After installing VMware Server I get the following error when I try to access
After installing the F# September CTP (1.9.6.2), Visual Studio 2008 frequently gives an error
After installing and setting up node.js on my development VM running Ubuntu 11.10, I
After installing the QuickReport 5.0 version, I get property error messages on all Reports
After installing Snow Leopard I got the following error when connecting to a remote
After installing CodeCollab on OS X 10.6, I get Error: Unable to run ccollabgui
I've been getting this error after installing rvm and rails with rvm. Can anyone
After installing Debugger Canvas and restarting Visual Studio, I get this error for each
after installing FOSUserBundle, now Im trying to login with user/ userpass but I still

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.