Skip to content

Instantly share code, notes, and snippets.

class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new # guest user
if user.role?(:admin)
can :manage, :all
end
end
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new # guest user
end
end
<h1>N3rd</h1>
<table>
<% @n3rds.each do |n3rd| %>
<tr>
<td><%= image_tag(n3rd.image_url, class: 'list_image') %></td>
<td><%= link_to n3rd.title, n3rd_with_title_path(n3rd, :title => n3rd.title)%></td>
NoMethodError in Posts#show
Showing /Users/kennyvb/GitHub/frakklerne/app/views/posts/show.html.erb where line #20 raised:
undefined method `each' for /uploads/post/image/3/Dirloads_IMG_0097.PNG_MB.png:PostimageUploader
Extracted source (around line #20):
17:
18: <p>Tags: <%= raw @post.tag_list.map { |t| link_to t, tag_path(t) }.join(', ') %></p>
Hi
After literally hours of trial and error (I'm not a Linux guy but love playing with my Raspberry Pi's), I have FINALLY got shairport-sync running on ArchLinux Arm 7 on my Raspberry Pi 2. I used numerous different sources to find all the different workarounds. I documented it and would like to give something back to the community... so here it is. I hope it's helpful.
Disclaimer: I'm sure I could have been a lot more efficient in my approach but I hope this will serve as a starting point for others.
1) RaspberryPi.org are not offering an ArchLinux image for Arm7 yet but some friendly guy has created his own and kindly put it on Mega.co.nz for all to use. Download the ArchLinux Arm 7 image for Raspberry Pi 2 from here: https://mega.co.nz/#!2JZS0CqD!KxlXr9B6URZ79zTP23vKVdrdOGVOYIeasjcjcBMoPzo
2) Write to a formatted SD card (at least 4GB) using Win32DiskImager.
[code]
16/02/2016 17:02:50 [12904] [DEBUG] [mail@mail.com] -------- Start
16/02/2016 17:02:50 [12904] [ INFO] [mail@mail.com] Version='2.2.8' method='OPTIONS' from='xx.xx.xx.xxx' cmd='' getUser='mail@mail.com' devId='' devType=''
16/02/2016 17:02:50 [12904] [DEBUG] [mail@mail.com] NoPostRequestException: Options request - code: 1 - file: /usr/share/webapps/z-push/index.php:151
16/02/2016 17:02:50 [12904] [DEBUG] [mail@mail.com] Including backend file: '/usr/share/www/nginx/z-push/backend/imap/imap.php'
16/02/2016 17:02:50 [12904] [DEBUG] [mail@mail.com] ZPush::GetSupportedProtocolVersions(): 12.0,12.1,14.0
16/02/2016 17:02:50 [12904] [DEBUG] [mail@mail.com] ZPush::GetSupportedCommands(): Sync,SendMail,SmartForward,SmartReply,GetAttachment,GetHierarchy,CreateCollection,DeleteCollection,MoveCollection,FolderSync,FolderCreate,FolderDelete,FolderUpdate,MoveItems,GetItemEstimate,MeetingResponse,ResolveRecipients,ValidateCert,Provision,Search,Ping,Notify,ItemOperations,Settings
16/02/2016 17:02:50 [12904] [ INFO] [