2014-01-20 57 views
0

我已經把我的代碼上github但是當我推到heroku無法推入到heroku master-rake中止?

錯誤: -

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 [email protected]:sheltered-ravine-2545.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]: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 . 
+0

您可以發佈您的application.js文件? – JKillian

+0

我已添加'application.js'.i在git上有我的代碼。 –

+0

我想我應該刪除'// = twitter/bootstrap'。? –

回答

0

application.js文件需要一個名爲bootstrap.js一本線稱爲twitter文件夾中的文件:

//= require twitter/bootstrap 

因此,添加所需的文件,bootstrap.jsvendor/assets/javascripts/twitter/


或者,如果你不希望該文件作爲應用程序的一部分,只是刪除了這一行需要它。

+0

我已經嘗試過,但沒有非我的JavaScript代碼正在工作。 –

+0

嘗試此操作後有什麼錯誤? – JKillian

+0

'application.js'中的代碼不起作用。 –

0

運行軟件包安裝後,你運行生成器?

rails generate bootstrap:install static

+0

謝謝但它有什麼不同? –

+0

這些是從官方網站(http://twbs.github.io/bootstrap/)安裝'twitter-bootstrap-rails' gem的說明將gem放入gemfile,運行bundle install然後運行生成器。 – Aluxzi