Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enumerator method problem in ruby 1.9.2 #6

Closed
wemerson opened this issue Aug 19, 2011 · 2 comments
Closed

Enumerator method problem in ruby 1.9.2 #6

wemerson opened this issue Aug 19, 2011 · 2 comments

Comments

@wemerson
Copy link

Love how easy this make barcode creation but I have a problem displaying the barcode. I had some trouble getting everything installed but now I can generate an eps file just fine but it fails to create the png file and display the barcode in the view. I get this error:

ActionView::Template::Error (undefined method join' for #<Enumerator: []:collect>): 9: <%= @label.description %> 10: </p> 11: 12: <p><%= barcode @label.code %></p> 13: 14: <p> 15: <%= link_to "Edit", edit_label_path(@label) %> | app/views/labels/show.html.erb:12:in_app_views_labels_show_html_erb___1939771989001282335_2169264860_1747278781368551234'

When I run the tests, it points back to barcode_generator/lib/imagemagickwrapper.rb

system("convert #{options.collect.join(' ')} #{src} #{out}")

The error says Enumerable doesn't have a method 'join'.

When I run convert from the command line with no options, it creates the png file. When I remove options from the imagemagickwrapper.rb line, the barcode displays fine in the view.

I'm not well-versed in ruby innards so I'm not attempting a fix, just reporting.
I'm using ruby 1.9.2
rails 3.0.9
imagemagick 6.7.1-1
gbarcode for ruby 1.9

Thanks for any help,
Will Emerson

@taasaa
Copy link

taasaa commented Aug 24, 2011

Just replace this line:

system("convert #{options.collect.join(' ')} #{src} #{out}")

with this one:

system("convert #{options.join(' ')} #{src} #{out}")

Worked for me.

@wemerson
Copy link
Author

Wow! That was easy. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants