2017-06-12 136 views
1

當我做「git push heroku master」時,在日誌結尾處出現此錯誤。無法推送到heroku(不會編譯ruby應用程序)

remote: ! 
remote: !  Precompiling assets failed. 
remote: ! 
remote: !  Push rejected, failed to compile Ruby app. 
remote: 
remote: !  Push failed 
remote: Verifying deploy... 
remote: 
remote: !  Push rejected to johnz-project. 
remote: 
To https://git.heroku.com/johnz-project.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'https://git.heroku.com/johnz-project.git' 

還了日誌中的某個地方,我看到了這一點:

Can't find file jquery-ui/effect-blind 

不知道爲什麼,因爲我加入了jQuery UI的護欄寶石我的Gemfile,並在應用中工作發展。

的application.js

//= require jquery 
//= require jquery-ui/effect-blind 
//= require jquery_ujs 
//= require bootstrap 
//= require lightbox-bootstrap 
//= require custom 
//= require turbolinks 
//= require_tree . 

application.scss

@import "bootstrap"; 
@import "lightbox-bootstrap"; 
@import "font-awesome"; 
@import "jquery-ui"; 

請幫幫忙!

編輯:

後做事 「的Heroku運行耙分貝:遷移」 我在堆棧跟蹤某個地方得到這個錯誤:

ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "categories" does not exist: 
CREATE TABLE "products" ("id" serial primary key, "title" character varying, 
"description" character varying, "category_id" integer, "picture" character varying, "video" character varying, "created_at"  
timestamp NOT NULL, "updated_at" timestamp NOT NULL, CONSTRAINT "fk_rails_fb915499a4"               
FOREIGN KEY ("category_id") REFERENCES "categories" ("id")) 

編輯:

應該怎麼辦這樣的:

development: 
    <<: *default 
    database: db/development.postgresql 

回答

0

它看起來像你的資產沒有在heroku上編譯。

按照以下代碼:

配置/環境/ production.rb

config.assets.compile = true 

然後運行命令:

RAILS_ENV=production rake assets:precompile 

然後按所有編譯後的文件與menifest文件的Heroku。

+0

第二條命令後出現此錯誤:Sprockets :: FileNotFound:找不到類型爲'application/javascript'的文件'jquery' – JohnnyDevv

+0

將gem'jquery-rails',「〜> 2.3.0」放入Gemfile 。運行'bundle install'並推送到heroku – puneet18

+0

確保'// = require jquery-ui'在bundle安裝後位於application.js – puneet18

相關問題