gpt4 book ai didi

ruby-on-rails - ruby sass-rails gem 和 heroku 推送错误

转载 作者:数据小太阳 更新时间:2023-10-29 07:24:41 25 4
gpt4 key购买 nike

在我的电脑上一切正常,但我无法推送到 Heroku。
我正在做名为“Ruby on Rails 教程(第 3 版)”,他们希望我在 Gemfile 中有一行

gem 'sass-rails',   '5.0.1'

如果没有那一行,我在推送时没有问题,但如果添加这一行,我会得到:

->git push heroku master 
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 321 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.1
remote: -----> Installing dependencies using 1.7.12
remote: Ruby version change detected. Clearing bundler cache.
remote: Old: ruby 2.0.0p643 (2015-02-25 revision 49749) [x86_64-linux]
remote: New: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Fetching gem metadata from https://rubygems.org/...........
remote: Using rake 10.4.2
remote: Installing minitest 5.5.1
remote: Installing i18n 0.7.0
remote: Installing thread_safe 0.3.5
remote: Installing builder 3.2.2
remote: Installing mini_portile 0.6.2
remote: Installing erubis 2.7.0
remote: Installing rack 1.6.0
remote: Installing mime-types 2.4.3
remote: Installing coffee-script-source 1.9.1.1
remote: Installing arel 6.0.0
remote: Installing execjs 2.5.2
remote: Installing thor 0.19.1
remote: Installing json 1.8.2
remote: Using bundler 1.7.12
remote: Installing multi_json 1.11.0
remote: Installing rails_stdout_logging 0.0.3
remote: Using rdoc 4.2.0
remote: Installing rails_serve_static_assets 0.0.4
remote: Installing tilt 1.4.1
remote: Installing sass 3.4.13
remote: Installing tzinfo 1.2.2
remote: Installing rack-test 0.6.3
remote: Installing sprockets 3.0.0
remote: Installing mail 2.6.3
remote: Installing coffee-script 2.4.1
remote: Installing uglifier 2.5.3
remote: Installing sdoc 0.4.0
remote: Installing rails_12factor 0.0.2
remote: Installing activesupport 4.2.0
remote: Installing rails-deprecated_sanitizer 1.0.3
remote: Installing globalid 0.3.5
remote: Installing activemodel 4.2.0
remote: Installing jbuilder 2.2.3
remote: Installing activejob 4.2.0
remote: Installing activerecord 4.2.0
remote: Installing pg 0.17.1
remote: Installing nokogiri 1.6.6.2
remote: Installing rails-dom-testing 1.0.6
remote: Installing loofah 2.0.1
remote: Installing rails-html-sanitizer 1.0.2
remote: Installing actionview 4.2.0
remote: Installing actionpack 4.2.0
remote: Installing actionmailer 4.2.0
remote: Installing sprockets-rails 2.2.4
remote: Installing railties 4.2.0
remote: Installing coffee-rails 4.1.0
remote: Installing jquery-rails 4.0.3
remote: Installing rails 4.2.0
remote: Installing sass-rails 5.0.1
remote: Installing turbolinks 2.3.0
remote: Your bundle is complete!
remote: Gems in the groups development and test were not installed.
remote: It was installed into ./vendor/bundle
remote: Bundle completed (31.90s)
remote: Cleaning up the bundler cache.
remote: Could not detect rake tasks
remote: ensure you can run `$ bundle exec rake -P` against your app with no environment variables present
remote: and using the production group of your Gemfile.
remote: This may be intentional, if you expected rake tasks to be run
remote: cancel the build (CTRL+C) and fix the error then commit the fix:
remote: rake aborted!
remote: NameError: uninitialized constant Sass::Script
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails/helpers.rb:11:in `<top (required)>'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails.rb:8:in `require'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails.rb:8:in `<top (required)>'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass-rails.rb:1:in `require'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass-rails.rb:1:in `<top (required)>'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/bundle/ruby/2.2.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:76:in `require'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/bundle/ruby/2.2.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/bundle/ruby/2.2.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:72:in `each'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/bundle/ruby/2.2.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:72:in `block in require'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/bundle/ruby/2.2.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:61:in `each'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/bundle/ruby/2.2.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:61:in `require'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/bundle/ruby/2.2.0/gems/bundler-1.7.12/lib/bundler.rb:134:in `require'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/config/application.rb:7:in `<top (required)>'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/Rakefile:4:in `require'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/Rakefile:4:in `<top (required)>'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/rake_module.rb:28:in `load'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/rake_module.rb:28:in `load_rakefile'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:689:in `raw_load_rakefile'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:94:in `block in load_rakefile'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:93:in `load_rakefile'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:77:in `block in run'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:75:in `run'
remote: /tmp/build_c3f0fc873b0d5baf26f3fbbfb448e8a1/vendor/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
remote: vendor/bundle/bin/rake:16:in `load'
remote: vendor/bundle/bin/rake:16:in `<main>'
remote:
remote: ###### WARNING:
remote: No Procfile detected, using the default web server (webrick)
remote: https://devcenter.heroku.com/articles/ruby-default-web-server
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for Ruby -> console, rake, web, worker
remote:
remote: -----> Compressing... done, 29.0MB
remote: -----> Launching... done, v8
remote: https://warm-bayou-7787.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/warm-bayou-7787.git
7b733ac..a4a374f master -> master

但是当我跑的时候,如他们所愿

->heroku run -a warm-bayou-7787 bundle exec rake -P

我明白了

    Running `bundle exec rake -P` attached to terminal... up, run.4029
rake aborted!
NameError: uninitialized constant Sass::Script
/app/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails/helpers.rb:11:in `<top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails.rb:8:in `require'
/app/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass/rails.rb:8:in `<top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass-rails.rb:1:in `require'
/app/vendor/bundle/ruby/2.2.0/gems/sass-rails-5.0.1/lib/sass-rails.rb:1:in `<top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:76:in `require'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:72:in `each'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:72:in `block in require'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:61:in `each'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.7.12/lib/bundler/runtime.rb:61:in `require'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.7.12/lib/bundler.rb:134:in `require'
/app/config/application.rb:7:in `<top (required)>'
/app/Rakefile:4:in `require'
/app/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
WARNING: Toolbelt v3.31.3 update available.

我该怎么办?我有一种感觉,就像之前一直在做那个教程一样,我从来没有遇到任何问题,一切都很好。

如果我删除 sass 并再次推送一次一切正常

最佳答案

我刚刚在 Cloud9 路由上遇到了同样的错误,并通过在 gemfiles 中使用 5.0.2+ 版本修复了它。

https://github.com/josh/sprockets-es6/issues/15

关于ruby-on-rails - ruby sass-rails gem 和 heroku 推送错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29593765/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com