skandragon / thing

Apache License 2.0
8 stars 10 forks source link

Trying to set up and document a development environment #135

Open funkymonkeymonk opened 7 years ago

funkymonkeymonk commented 7 years ago

Hello thing devs,

Was trying to figure out how to set up a development environment. I've forked the repo and been documenting my efforts on the main branch of my fork.

I'm currently having an issue running the tests. I'm getting multiple errors based around btrsort. Below is an example:


     Failure/Error:
       @instances.each { |instance|
         cal.event do |event|
           instructable = instance.instructable
           prefix = []
           prefix << "Subject: #{instructable.formatted_topic}"
           prefix << "Instructor: #{instructable.titled_sca_name}"
           prefix << "Additional Instructors: #{instructable.additional_instructors.join(', ')}" if instructable.additional_instructors.present?
           prefix << "Material limit: #{instructable.material_limit}" if instructable.material_limit
           prefix << "Handout limit: #{instructable.handout_limit}" if instructable.handout_limit

     ActiveRecord::StatementInvalid:
       PG::UndefinedFunction: ERROR:  function btrsort(character varying) does not exist
       LINE 1: ...ances"."instructable_id" = 1 ORDER BY start_time, btrsort(lo...
                                                                    ^
       HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
       : SELECT "instances".* FROM "instances" WHERE "instances"."year" = $1 AND "instances"."instructable_id" = 1 ORDER BY start_time, btrsort(location)
     # ./app/lib/calendar_renderer.rb:32:in `block in render_ics'
     # ./app/lib/calendar_renderer.rb:24:in `render_ics'
     # ./app/controllers/users/schedules_controller.rb:35:in `block (2 levels) in show'
     # ./app/controllers/users/schedules_controller.rb:22:in `show'
     # ./spec/controllers/users/schedules_controller_spec.rb:224:in `block (4 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # PG::UndefinedFunction:
     #   ERROR:  function btrsort(character varying) does not exist
     #   LINE 1: ...ances"."instructable_id" = 1 ORDER BY start_time, btrsort(lo...
     #                                                                ^
     #   HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
     #   ./app/lib/calendar_renderer.rb:32:in `block in render_ics'

Finished in 1.12 seconds (files took 4.14 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/controllers/users/schedules_controller_spec.rb:223 # Users::SchedulesController this-user #show with formats renders ics```

Can you offer and assistance in getting this set up? My current guess is my version of postgres is possibly to new. What version of postgres are you using on the server?
funkymonkeymonk commented 7 years ago

Also happy to set up a PR to work out of it it's easier to communicate there.