推送到Heroku后的应用程序错误

时间:2014-08-02 00:29:26

标签: heroku

我是新手,我用Google搜索了这个问题,没有任何帮助。有人可以向我解释错误是什么吗?我已经尝试过git add,然后提交再次推送到heroku那些东西。

2014-08-02T00:19:10.428030+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=practice-pinteresting.herokuapp.com request_id=24c5ed75-ab66-4898-bb58-eaf24ffbefce fwd="98.113.185.141" dyno= connect= service= status=503 bytes=
2014-08-02T00:19:18.838612+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=practice-pinteresting.herokuapp.com request_id=9c7ca0d0-cfb3-4744-afed-be703a5b1d2e fwd="98.113.185.141" dyno= connect= service= status=503 bytes=
2014-08-02T00:19:20.835561+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=practice-pinteresting.herokuapp.com request_id=bf617e64-6239-4ace-87ec-eef119aef160 fwd="98.113.185.141" dyno= connect= service= status=503 bytes=
2014-08-02T00:19:24.217825+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=practice-pinteresting.herokuapp.com request_id=d767da81-9330-472c-aaa4-a53c06c4e303 fwd="98.113.185.141" dyno= connect= service= status=503 bytes=
2014-08-02T00:19:28.047936+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=practice-pinteresting.herokuapp.com request_id=cab55122-63b5-42f6-b444-8cd0537246eb fwd="98.113.185.141" dyno= connect= service= status=503 bytes=
2014-08-02T00:19:30.317759+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=practice-pinteresting.herokuapp.com request_id=79743c93-d65e-435a-8aec-39c87093e475 fwd="98.113.185.141" dyno= connect= service= status=503 bytes=

1 个答案:

答案 0 :(得分:0)

O.k。弄清楚了。你的pins_controller.rb中的“结束”搞砸了。如果你删除第52行的结尾(是最后一个)和第40行它应该工作,它为我做了我现在正在看你的应用程序。

只是你知道我通过使用

弄明白了
 heroku run rails c

有时会为您提供更多有用的信息,在这种情况下,它指向您的控制器并告诉我有关语法错误。

如果您想要复制并粘贴此代码应该在下面工作,它适用于我,请不要忘记点击复选标记,如果这解决了您的问题。

class PinsController < ApplicationController
   before_action :set_pin, only: [:show, :edit, :update, :destroy]

   def index
     @pins = Pin.all
    end

   def show
   end

   def new
    @pin = Pin.new
   end

   def edit
   end

  def create
    @pin = Pin.new(pin_params)

    if @pin.save
      redirect_to @pin, notice: 'Pin was successfully created.' 
     else
    render :new 
  end
end

 def update
     if @pin.update(pin_params)
       redirect_to @pin, notice: 'Pin was successfully updated.'
     else
      render :edit 
    end
  end
end

 def destroy
   @pin.destroy
    redirect_to pins_url
 end

  private
     #Use callbacks to share common setup or constraints between actions.
  def set_pin
    @pin = Pin.find(params[:id])
   end

   # Never trust parameters from the scary internet, only allow the white list through.
   def pin_params
     params.require(:pin).permit(:description)
   end