heroku不能推送引用

问题描述 投票:0回答:1
Installing node-v6.11.1-linux-x64
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       SyntaxError:         /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/config/routes.rb:4: syntax error, unexpected keyword_end, expecting end-of-input
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `block in load'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:55:in `block in load_paths'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:55:in `each'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:55:in `load_paths'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:18:in `reload!'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:41:in `block in updater'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/file_update_checker.rb:81:in `execute'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:42:in `updater'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:31:in `execute_if_updated'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:128:in `block in <module:Finisher>'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/config/environment.rb:5:in `<top (required)>'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:329:in `require'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:329:in `require_environment!'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:445:in `block in run_tasks_blocks'
   /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
       /tmp/build_fdfdda041ac97232ad8bd0b00c54c482/vendor/bundle/ruby/2.3.0/gems/rake-    12.3.0/exe/rake:27:in `<top (required)>'
       Tasks: TOP => environment
       (See full trace by running task with --trace)
 !
 !     Precompiling assets failed.
 !
 !     Push rejected, failed to compile Ruby app.
 !     Push failed

这篇教程的新篇章,遵循本教程:http://installfest.railsbridge.org/installfest/deploy_a_rails_app

在输入命令“git push heroku master”之后,我不确定为什么我在这里得到这个预编译错误。此外,当我在tmp文件夹中查找抛出语法错误的文件时,它不会显示(可能是因为它在运行命令后消失)。

在我的routes.rb文件中,我有:

root 'drinks#index'
resources :drinks
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
ruby-on-rails git heroku
1个回答
0
投票

问题是你的routes.rb有语法错误。解析器找到一个end,没有相应的do(开头)。你完整的routes.rb应该是这样的:

Rails.application.routes.draw do
  root 'drinks#index'
  resources :drinks
  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
© www.soinside.com 2019 - 2024. All rights reserved.