Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';t推送到heroku(不会编译ruby应用程序)_Heroku_Ruby On Rails 5 - Fatal编程技术网

Can';t推送到heroku(不会编译ruby应用程序)

Can';t推送到heroku(不会编译ruby应用程序),heroku,ruby-on-rails-5,Heroku,Ruby On Rails 5,当我执行“git-push-heroku-master”时,我在日志末尾得到了这个错误 remote: ! remote: ! Precompiling assets failed. remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: !

当我执行“git-push-heroku-master”时,我在日志末尾得到了这个错误

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 rails gem添加到我的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 run rake db:migrate”之后,我在stacktrace中的某个地方发现了这个错误:

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
开发:

看起来您的资产没有在heroku上编译

请遵循以下代码:

config/environments/production.rb 然后运行命令:

RAILS_ENV=production rake assets:precompile

然后将所有已编译的文件连同menifest文件一起推送到heroku。

看起来您的资产没有在heroku上编译

请遵循以下代码:

config/environments/production.rb 然后运行命令:

RAILS_ENV=production rake assets:precompile

然后将所有编译好的文件连同menifest文件一起推送到heroku。

在第二个命令之后,我出现了这个错误:Sprockets::FileNotFound:找不到类型为“application/javascript”的文件“jquery”,将“~>2.3.0”放入Gemfile中。运行
bundle install
并推送到herokuMake确保
/=require jquery ui
在应用程序中。js bundle安装后,我收到了以下错误:Bundler无法找到gem“railties”的兼容版本:在Gemfile中:jquery rails(~>2.3.0)x86-mingw32解析为2.3.0,这取决于railties(<5.0,>=3.0)x86-mingw32 rails(~>5.0.2)x86-mingw32解析为5.0.2,这取决于railties(=5.0.2)x86-mingw32添加
gem'jquery rails'
并运行bundle在第二个命令:Sprockets::FileNotFound:找不到类型为“application/javascript'Put gem'jquery rails',“~>2.3.0”的文件“jquery”。运行
bundle install
并推送到herokuMake确保
/=require jquery ui
在应用程序中。js bundle安装后,我收到了以下错误:Bundler无法找到gem“railties”的兼容版本:在Gemfile中:jquery rails(~>2.3.0)x86-mingw32解析为2.3.0,这取决于railties(<5.0,>=3.0)x86-mingw32 rails(~>5.0.2)x86-mingw32已解析为5.0.2,这取决于railties(=5.0.2)x86-mingw32添加
gem'jquery rails'
和运行包