无法推进heroku master-rake中止?

时间:2014-01-20 16:15:56

标签: ruby-on-rails ruby git twitter-bootstrap heroku

我已将代码放在github上,但当我推送到heroku

错误: -

rake aborted!
   couldn't find file 'twitter/bootstrap'
   (in /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/app/assets/javascript
s/application.js:15)
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/context.rb:106:in `resolve'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/context.rb:146:in `require_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/directive_processor.rb:217:in`process_requi
re_directive'
/tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/directive_processor.rb:167:in `block in  process_directives'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/directive_processor.rb:165:in `each'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/directive_processor.rb:165:in `process_directives'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/directive_processor.rb:99:in `evaluate'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/context.rb:197:in `block in evaluate'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/context.rb:194:in `each'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/context.rb:194:in `evaluate'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/processed_asset.rb:12:in `initialize'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/base.rb:374:in `new'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/base.rb:374:in `block in build_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/base.rb:395:in `circular_call_protection'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/base.rb:373:in `build_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/index.rb:94:in `block in build_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/caching.rb:58:in `cache_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/index.rb:93:in `build_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/base.rb:287:in `find_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/index.rb:61:in `find_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/bundled_asset.rb:16:in `initialize'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/base.rb:377:in `new'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/base.rb:377:in `build_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/index.rb:94:in `block in build_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/caching.rb:58:in `cache_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/index.rb:93:in `build_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/base.rb:287:in `find_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/index.rb:61:in `find_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/manifest.rb:211:in `block in find_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/manifest.rb:257:in `benchmark'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/manifest.rb:210:in `find_asset'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/manifest.rb:119:in `block in compile'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/manifest.rb:118:in `each'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/sprockets/manifest.rb:118:in `compile'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:60:in `block (3 levels) i
n define'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.10.1/lib/rake/sprocketstask.rb:146:in `with_logger'
   /tmp/build_84917108-19fa-4e88-8644-70f8ceccdb4f/vendor/bundle/ruby/2.0.0/
gems/sprockets-rails-2.0.1/lib/sprockets/rails/task.rb:59:in `block (2   levels) i
n define'
   Tasks: TOP => assets:precompile
   (See full trace by running task with --trace)
 !
 !     Precompiling assets failed.
 !

 !     Push rejected, failed to compile Ruby app

To git@heroku.com:sheltered-ravine-2545.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:sheltered-ravine-2545.git'`

当我添加gem twitter-bootstrap-rails时,它显示不同的错误,因为我正在处理windows sass无法加载。

我的宝石文件

source 'https://rubygems.org'
gem 'rails', '4.0.0'
gem 'pg'
gem 'sass-rails', '~> 4.0.0'
gem 'protected_attributes'


gem 'uglifier', '>= 1.3.0'


gem 'coffee-rails', '~> 4.0.0'
gem "devise", "~> 3.2.2"
gem "highcharts-rails", "~> 3.0.7"



gem 'jquery-rails'


gem 'turbolinks'


gem 'jbuilder', '~> 1.2'

group :doc do
gem 'sdoc', require: false
end

在我的 applicaition.js

 // This is a manifest file that'll be compiled into application.js, which will include all the files
 // listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require turbolinks
//= require_tree .

2 个答案:

答案 0 :(得分:0)

您的application.js文件需要名为bootstrap.js的文件夹中名为twitter的文件,并带有以下行:

//= require twitter/bootstrap

因此,将所需文件bootstrap.js添加到vendor/assets/javascripts/twitter/


或者,如果您不希望该文件作为应用程序的一部分,请删除需要该文件的那一行。

答案 1 :(得分:0)

运行捆绑安装后,您是否运行了生成器?

rails generate bootstrap:install static