相关疑难解决方法(0)

(Rails 5) LoadError: 无法加载此类文件 -- sass ...部署到 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)>' …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails heroku gemfile

11
推荐指数
2
解决办法
2万
查看次数

标签 统计

gemfile ×1

heroku ×1

ruby ×1

ruby-on-rails ×1