srushti / goldberg

Goldberg is a lightweight CI server written in Ruby which worries about Bundler & RVM so that you don't have to.
Other
242 stars 29 forks source link

undefined method `empty?' for nil:NilClass #70

Closed localshred closed 13 years ago

localshred commented 13 years ago

I ran into an error trying to force a build on a new project I created. I was able to add the project using bin/goldberg add. After adding the project I launched the app with bin/goldberg start 3001. When I click force build on the project, nothing appears to happen (not sure if that is normal behavior), then when I click the project to see its builds, I get the standard Rails "We're sorry but something went wrong" error. Checking production.log yields the following error:

Started GET "/projects/amigo-master" for 172.16.0.70 at 2011-06-02 10:31:03 -0600
  Processing by ProjectsController#show as HTML
  Parameters: {"project_name"=>"amigo-master"}
Rendered projects/show.html.haml within layouts/application (1.8ms)
Completed   in 4ms

ActionView::Template::Error (undefined method `empty?' for nil:NilClass):
    22:       = @project.name
    23:       %em.project_ruby (#{@project.ruby})
    24:       %strong.project_status= "#{build_status(@build)}"
    25:     - unless @build.artefacts.empty?
    26:       %ul
    27:         Build artefacts
    28:         - @build.artefacts.each do |artefact|
  app/views/projects/show.html.haml:25:in `_app_views_projects_show_html_haml__3906049776127963241_30547500_2133775230302929165'

What is the best way to get around this?

localshred commented 13 years ago

After altering that view (- unless @build.artefacts.nil? || @build.artefacts.empty?) I can get in and see the project page, but clicking force build ends up doing nothing. I'm not seeing any errors in the rails log.

srushti commented 13 years ago

Currently, there are two modes of running goldberg.

  1. In development mode, the web server starts the builder in a separate thread.
  2. In production mode, it just runs the web server. Here, you'll need to run the builder in a separate window by calling bin/goldberg start_poller (using the production environment of course). Our understanding was that someone running it in production will probably start it using apache+passenger or some such set up, where we wouldn't be able to start the poller. I just realised this second mode hasn't been documented in the README, and I'll make sure to add that in.

There seems to be a separate issue where if you go to a project's page before any builds have been created it barfs. I'm fixing that presently.

localshred commented 13 years ago

Excellent, thank you for the quick response! I'll run the poller and see how things go.

srushti commented 13 years ago

Fixed the empty? problem in cc2234.