2017-06-12 134 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

相关问题