当前位置 : 主页 > 编程语言 > ruby >

ruby-on-rails – Rails 3.2 rake编译问题

来源:互联网 收集:自由互联 发布时间:2021-06-23
突然不能推到Heroku!错误消息说: uninitialized constant Haml::Util::Sass (相同的代码和库在2天前工作正常!) 编译显然在这行application.rb上失败了: Bundler.require(*Rails.groups(:assets = %w(development
突然不能推到Heroku!错误消息说:

uninitialized constant Haml::Util::Sass

(相同的代码和库在2天前工作正常!)

编译显然在这行application.rb上失败了:

Bundler.require(*Rails.groups(:assets => %w(development test)))

在尝试编译时,我得到了这个:

Could not detect rake tasks ensure you can run $bundle exec
rake -P
against your app with no environment variables present and
using the production group of your Gemfile. This may be
intentional, if you expected rake tasks to be run cancel the build
(CTRL+C) and fix the error then commit the fix: rake aborted!
uninitialized constant Haml::Util::Sass

完整堆栈跟踪:

/tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/haml-3.1.6/lib/haml/util.rb:348:in `try_sass'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/haml-3.1.6/lib/sass/rails3_shim.rb:1:in `<top (required)>'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/sass-3.3.2/lib/sass/root.rb:1:in `<top (required)>'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/sass-3.3.2/lib/sass/util.rb:10:in `<top (required)>'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/sass-3.3.2/lib/sass/version.rb:2:in `<top (required)>'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/haml-3.1.6/lib/haml/util.rb:347:in `try_sass'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/haml-3.1.6/lib/sass.rb:6:in `<top (required)>'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/bundler-1.5.2/lib/bundler/runtime.rb:76:in `require'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/bundler-1.5.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
    gems/bundler-1.5.2/lib/bundler/runtime.rb:72:in `each'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
    gems/bundler-1.5.2/lib/bundler/runtime.rb:72:in `block in require'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
    gems/bundler-1.5.2/lib/bundler/runtime.rb:61:in `each'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
    gems/bundler-1.5.2/lib/bundler/runtime.rb:61:in `require'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/bundler-1.5.2/lib/bundler.rb:131:in `require'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/config/application.rb:7:i
n `<top (required)>'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/Rakefile:5:in `require'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/Rakefile:5:in `<top (requ
ired)>'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load_rakefile'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/rake-10.0.3/lib/rake/application.rb:583:in `raw_load_rakefile'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/rake-10.0.3/lib/rake/application.rb:89:in `block in load_rakefile'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/rake-10.0.3/lib/rake/application.rb:88:in `load_rakefile'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/rake-10.0.3/lib/rake/application.rb:72:in `block in run'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
       /tmp/build_ae51e5ec-bc73-4105-bce5-33edbe8bee32/vendor/bundle/ruby/1.9.1/
gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
       vendor/bundle/bin/rake:16:in `load'

   vendor/bundle/bin/rake:16:in `<main>'
-----> WARNINGS:
   Injecting plugin 'rails_log_stdout'
   Injecting plugin 'rails3_serve_static_assets'
   Add 'rails_12factor' gem to your Gemfile to skip plugin injection
   Removing `Gemfile.lock` because it was generated on Windows.
   Bundler will do a full resolve so native gems are handled properly.
   This may result in unexpected gem versions being used in your app.
   In rare occasions Bundler may not be able to resolve your dependencies at all.
   https://devcenter.heroku.com/articles/bundler-windows-gemfile
-----> Discovering process types
   Procfile declares types -> (none)
   Default types for Ruby  -> console, rake, web, worker

的Gemfile:

source 'https://rubygems.org'
ruby "1.9.3"
gem 'rails', '3.2.11'
gem 'useragent'
gem 'rubyzip', '~> 1.0.0'
gem 'vpim'
gem 'ri_cal'
gem "geocoder"
gem 'sass'
gem 'haml', '3.1.6'
gem 'settingslogic', '~> 2.0.8'
gem 'devise', '2.1.2'
gem 'omniauth', '1.1.0'
gem 'omniauth-facebook', '1.4.1'
gem 'omniauth-twitter'
gem 'omniauth-linkedin'
gem "omniauth-google", "~> 1.0.2"
gem 'paperclip', '~> 3.3.0'
gem 'aws-s3', '~> 0.6.3'
gem 'aws-sdk', '~> 1.6.9'
gem 'delayed_job_active_record', '0.4.4'
gem "fb_graph", '2.4.19'
gem "linkedin"
gem "twitter"
gem "nokogiri", "~> 1.5.5"
gem "gdata", :git=> "https://github.com/agentrock/gdata.git"
gem 'acts_as_api', "0.4.1"
gem "rails_admin"
gem "meta_search", "~> 1.1.3"
gem "possessive", "~> 1.0.1"
gem "rake", "10.0.3"
gem 'newrelic_rpm'
gem "json", "1.7.7"
gem "omniauth-google-oauth2"
gem "google-api-client", :require => 'google/api_client'
gem "rest-client", "~> 1.6.7"
gem "customerio"

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails', '~> 2.1'
gem 'jquery-ui-rails', '~> 2.0.0'
gem 'jquery-fileupload-rails','~> 0.3.5'

group :development, :test do
  gem 'rspec-rails', '~> 2.13.0'
  gem 'factory_girl_rails', '4.0.0'
  gem "spork", "~> 0.9.2"
  gem 'hoe', '~> 3.4.0'
end

group :test do
  gem "shoulda",          ">=3.0.1"
  gem 'shoulda-matchers', "1.4.0"
  gem 'faker'
  gem 'capybara'
  gem 'guard-rspec'
  gem 'launchy'
end

group :development do
  gem 'sqlite3', '1.3.7'
end

group :staging, :production do
  gem 'pg', '0.13.2'
end
你正在使用haml 3.1.6,这是在这个版本的sass上打破.

最好的解决方法是更新到最新版本的haml 4.0.x:

$bundle update haml haml-rails
网友评论