![](/img/trans.png)
[英]`rails server` throws error “cannot load such file” — sass/logger (LoadError)
[英](Rails 5) LoadError: cannot load such file -- sass ...when deploying to Heroku
部署 Rails 5 應用程序時出現標題錯誤。 我最近更新了我的 Gemfile 以包含一些更新的版本。 我的本地開發環境沒有任何問題,但是當我推送到處於“生產模式”的 Heroku 時,出現一個似乎與資產預編譯有關的錯誤。
這是我在日志中看到的內容:
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: yarn install v1.22.10
remote: [1/5] Validating package.json...
remote: [2/5] Resolving packages...
remote: success Nothing to install.
remote: success Saved lockfile.
remote: Done in 0.07s.
remote: rake aborted!
remote: LoadError: cannot load such file -- sass
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `block in require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/autoload/sass.rb:1:in `<top (required)>'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `block in require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:47:in `initialize'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:26:in `new'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:26:in `instance'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:34:in `cache_key'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:93:in `processor_cache_key'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:22:in `block in initialize'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:53:in `processor_cache_key'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:102:in `block in processors_cache_keys'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:102:in `map'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:102:in `processors_cache_keys'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processing.rb:159:in `resolve_processors_cache_key_uri'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets.rb:162:in `block in <module:Sprockets>'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/dependencies.rb:67:in `resolve_dependency'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:23:in `block in initialize'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:59:in `resolve_dependency'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:268:in `block in resolve_dependencies'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:268:in `map'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:268:in `resolve_dependencies'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:55:in `block in load'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:311:in `block in fetch_asset_from_dependency_cache'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:307:in `each'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:307:in `each_with_index'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:307:in `fetch_asset_from_dependency_cache'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:66:in `find_asset'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:73:in `find_all_linked_assets'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:134:in `block in find'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:133:in `each'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:133:in `find'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:186:in `compile'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:67:in `block (3 levels) in define'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:66:in `block (2 levels) in define'
remote: Tasks: TOP => assets:precompile
remote: (See full trace by running task with --trace)
remote:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
這是我的 Gemfile
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
ruby "2.5.7"
gem 'rails', '5.2.4.3'
gem 'puma', '~> 3.12'
gem 'sdoc', '~> 0.4.0', group: :doc
gem "devise", ">= 4.7.1"
gem 'devise_token_auth'
gem 'activeadmin'
gem "paperclip"
gem 'aws-sdk'
gem 'dotenv-rails', :groups => [:development, :test]
gem 'bower-rails', '~> 0.11.0'
gem 'mysql2'
gem 'uglifier'
gem 'active_model_serializers', '~> 0.10.4'
gem 'nexmo', '4.8'
gem 'descriptive_statistics', '2.5.1'
# This is only for development mode, but Heroku always bundles the production group,
# so we need this here in case we're running Rails in development mode
gem 'listen', '>= 3.0.5', '< 3.2'
group :development, :test do
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
gem 'rb-readline'
end
group :development do
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
gem 'timecop'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
任何想法我如何解決這個問題? 我搜索並發現了一些與 Sprockets 和 sassc gem 相關的類似問題,但我沒有加載該 gem,所以我不確定 go 在哪里使用此信息。
部署 Rails 5 應用程序時,標題中出現錯誤。 我最近更新了我的 Gemfile 以包含一些更新的版本。 我的本地開發環境沒有任何問題,但是當我推送到處於“生產模式”的 Heroku 時,出現一個似乎與資產預編譯有關的錯誤。
這是我在日志中看到的內容:
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: yarn install v1.22.10
remote: [1/5] Validating package.json...
remote: [2/5] Resolving packages...
remote: success Nothing to install.
remote: success Saved lockfile.
remote: Done in 0.07s.
remote: rake aborted!
remote: LoadError: cannot load such file -- sass
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `block in require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/autoload/sass.rb:1:in `<top (required)>'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `block in require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:47:in `initialize'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:26:in `new'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:26:in `instance'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:34:in `cache_key'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:93:in `processor_cache_key'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:22:in `block in initialize'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:53:in `processor_cache_key'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:102:in `block in processors_cache_keys'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:102:in `map'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:102:in `processors_cache_keys'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processing.rb:159:in `resolve_processors_cache_key_uri'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets.rb:162:in `block in <module:Sprockets>'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/dependencies.rb:67:in `resolve_dependency'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:23:in `block in initialize'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:59:in `resolve_dependency'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:268:in `block in resolve_dependencies'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:268:in `map'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:268:in `resolve_dependencies'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:55:in `block in load'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:311:in `block in fetch_asset_from_dependency_cache'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:307:in `each'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:307:in `each_with_index'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:307:in `fetch_asset_from_dependency_cache'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:66:in `find_asset'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:73:in `find_all_linked_assets'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:134:in `block in find'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:133:in `each'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:133:in `find'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:186:in `compile'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:67:in `block (3 levels) in define'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:66:in `block (2 levels) in define'
remote: Tasks: TOP => assets:precompile
remote: (See full trace by running task with --trace)
remote:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
這是我的 Gemfile
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
ruby "2.5.7"
gem 'rails', '5.2.4.3'
gem 'puma', '~> 3.12'
gem 'sdoc', '~> 0.4.0', group: :doc
gem "devise", ">= 4.7.1"
gem 'devise_token_auth'
gem 'activeadmin'
gem "paperclip"
gem 'aws-sdk'
gem 'dotenv-rails', :groups => [:development, :test]
gem 'bower-rails', '~> 0.11.0'
gem 'mysql2'
gem 'uglifier'
gem 'active_model_serializers', '~> 0.10.4'
gem 'nexmo', '4.8'
gem 'descriptive_statistics', '2.5.1'
# This is only for development mode, but Heroku always bundles the production group,
# so we need this here in case we're running Rails in development mode
gem 'listen', '>= 3.0.5', '< 3.2'
group :development, :test do
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
gem 'rb-readline'
end
group :development do
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
gem 'timecop'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
任何想法我如何解決這個問題? 我搜索並發現了一些與 Sprockets 和 sassc gem 相關的類似問題,但我沒有加載該 gem,所以我不確定 go 在哪里使用此信息。
部署 Rails 5 應用程序時,標題中出現錯誤。 我最近更新了我的 Gemfile 以包含一些更新的版本。 我的本地開發環境沒有任何問題,但是當我推送到處於“生產模式”的 Heroku 時,出現一個似乎與資產預編譯有關的錯誤。
這是我在日志中看到的內容:
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: yarn install v1.22.10
remote: [1/5] Validating package.json...
remote: [2/5] Resolving packages...
remote: success Nothing to install.
remote: success Saved lockfile.
remote: Done in 0.07s.
remote: rake aborted!
remote: LoadError: cannot load such file -- sass
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `block in require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/autoload/sass.rb:1:in `<top (required)>'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `block in require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:257:in `load_dependency'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.4.3/lib/active_support/dependencies.rb:291:in `require'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:47:in `initialize'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:26:in `new'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:26:in `instance'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/sass_processor.rb:34:in `cache_key'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:93:in `processor_cache_key'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:22:in `block in initialize'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:53:in `processor_cache_key'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:102:in `block in processors_cache_keys'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:102:in `map'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processor_utils.rb:102:in `processors_cache_keys'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/processing.rb:159:in `resolve_processors_cache_key_uri'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets.rb:162:in `block in <module:Sprockets>'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/dependencies.rb:67:in `resolve_dependency'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:23:in `block in initialize'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:59:in `resolve_dependency'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:268:in `block in resolve_dependencies'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:268:in `map'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:268:in `resolve_dependencies'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:55:in `block in load'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:311:in `block in fetch_asset_from_dependency_cache'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:307:in `each'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:307:in `each_with_index'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:307:in `fetch_asset_from_dependency_cache'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/loader.rb:44:in `load'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/cached_environment.rb:47:in `load'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:66:in `find_asset'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/base.rb:73:in `find_all_linked_assets'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:134:in `block in find'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:133:in `each'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:133:in `find'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/manifest.rb:186:in `compile'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:67:in `block (3 levels) in define'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb:147:in `with_logger'
remote: /tmp/build_fbac64d9/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:66:in `block (2 levels) in define'
remote: Tasks: TOP => assets:precompile
remote: (See full trace by running task with --trace)
remote:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
這是我的 Gemfile
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
ruby "2.5.7"
gem 'rails', '5.2.4.3'
gem 'puma', '~> 3.12'
gem 'sdoc', '~> 0.4.0', group: :doc
gem "devise", ">= 4.7.1"
gem 'devise_token_auth'
gem 'activeadmin'
gem "paperclip"
gem 'aws-sdk'
gem 'dotenv-rails', :groups => [:development, :test]
gem 'bower-rails', '~> 0.11.0'
gem 'mysql2'
gem 'uglifier'
gem 'active_model_serializers', '~> 0.10.4'
gem 'nexmo', '4.8'
gem 'descriptive_statistics', '2.5.1'
# This is only for development mode, but Heroku always bundles the production group,
# so we need this here in case we're running Rails in development mode
gem 'listen', '>= 3.0.5', '< 3.2'
group :development, :test do
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
gem 'rb-readline'
end
group :development do
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
gem 'timecop'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
任何想法我如何解決這個問題? 我搜索並發現了一些與 Sprockets 和 sassc gem 相關的類似問題,但我沒有加載該 gem,所以我不確定 go 在哪里使用此信息。
添加生產.rb
config.assets.css_compressor = :yui
config.assets.js_compressor = :terser
並添加
gem 'sassc-rails'
這對我有用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.