Open jefsev opened 2 years ago
Thank you for reporting this. I will look into it right away. Would you mind sharing your platform too? (e.g. Mac Catalina or Windows 10).
Also, do you know what version of Ruby are you running? (you can run ruby -v
on the command line terminal to find out)
One last question is are you running the project by installing the gem or by cloning? If by cloning, did you perhaps forget to run bundle
first?
OK, I tested on the Mac (Catalina) by installing the gem and by starting with a cloned project from scratch, and both modes worked.
I will look into testing on Linux next (in case you are running on Linux).
I just tested on Ubuntu Linux 21 and had no issues either (both gem and repository modes).
I will need more info from you regarding my questions above to help you further.
OK, I found the issue by running an older version of Ruby (2.7.2).
2.7.2 :001 > :hello.name
Traceback (most recent call last):
4: from /Users/andymaleh/.rvm/rubies/ruby-2.7.2/bin/irb:23:in `<main>'
3: from /Users/andymaleh/.rvm/rubies/ruby-2.7.2/bin/irb:23:in `load'
2: from /Users/andymaleh/.rvm/rubies/ruby-2.7.2/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `<top (required)>'
1: from (irb):1
NoMethodError (undefined method `name' for :hello:Symbol)
The project clearly states it requires Ruby 3.0.2 to run. Please upgrade your Ruby installation to Ruby 3.0.2
The easiest way to do so is through RVM: https://rvm.io/
Good news! I just fixed compatibility with older Ruby versions down to 2.7.2 (and perhaps lower too).
I released the fix in version 0.0.13
Please give it a try and let me know if it works (you shouldn't have to upgrade Ruby anymore).
Cheers.
@AndyObtiva Thx for the quick reply! I was running 2.6.x which i updated to 3.0.2 which solved this issue.
But now when i run i get the following error: `jefsev@Jeffrey cryptopunks-gui % sudo ruby app/cryptopunks_gui.rb pixelart/1.2.1 on Ruby 3.0.2 (2021-07-07) [x86_64-darwin19] in (/Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/pixelart-1.2.1) cryptopunks/2.0.1 on Ruby 3.0.2 (2021-07-07) [x86_64-darwin19] in (/Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/cryptopunks-2.0.1)
ac39af4793119ee46bbff351d8cb6b5f23da60222126add4268e261199a2921b< SHA256 hash matching ✓ True Official Genuine CryptoPunks™ verified 2400x2400 (height x width) /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/tk-0.4.0/lib/tk.rb:1981:in
_invoke': couldn't recognize data in image file "/Users/jefsev/Local Sites/NFT-generator/CryptoPunkGUI/cryptopunkGui/cryptopunks-gui/icons/cryptopunks-gui.png" (RuntimeError) from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/tk-0.4.0/lib/tk.rb:1981:in
_ip_invoke_core' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/tk-0.4.0/lib/tk.rb:2016:in_tk_call_core' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/tk-0.4.0/lib/tk.rb:2043:in
tk_call_without_enc' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/tk-0.4.0/lib/tk/image.rb:81:ininitialize' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/tk-0.4.0/lib/tk/image.rb:192:in
initialize' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/tk-0.4.0/lib/tk/image.rb:59:inblock (2 levels) in new' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/tk-0.4.0/lib/tk/image.rb:58:in
synchronize' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/tk-0.4.0/lib/tk/image.rb:58:inblock in new' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/tk-0.4.0/lib/tk/image.rb:57:in
instance_eval' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/tk-0.4.0/lib/tk/image.rb:57:innew' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-dsl-tk-0.0.47/lib/glimmer/tk/widget_proxy.rb:449:in
image_argument' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-dsl-tk-0.0.47/lib/glimmer/tk/toplevel_proxy.rb:56:inset_attribute' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-dsl-tk-0.0.47/lib/glimmer/dsl/tk/attribute_expression.rb:37:in
interpret' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-2.5.1/lib/glimmer/dsl/engine.rb:181:inblock in interpret_expression' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-2.5.1/lib/glimmer/dsl/expression.rb:64:in
around' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-2.5.1/lib/glimmer/dsl/engine.rb:180:ininterpret_expression' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-2.5.1/lib/glimmer/dsl/engine.rb:175:in
interpret' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-2.5.1/lib/glimmer.rb:78:inmethod_missing' from app/cryptopunks_gui.rb:35:in
block in create_gui' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-2.5.1/lib/glimmer/dsl/parent_expression.rb:32:inadd_content' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-dsl-tk-0.0.47/lib/glimmer/dsl/tk/root_expression.rb:45:in
add_content' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-2.5.1/lib/glimmer/dsl/engine.rb:199:inadd_content' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-2.5.1/lib/glimmer/dsl/engine.rb:182:in
block (2 levels) in interpret_expression' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/facets-3.1.0/lib/core/facets/kernel/tap.rb:19:intap' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-2.5.1/lib/glimmer/dsl/engine.rb:181:in
block in interpret_expression' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-2.5.1/lib/glimmer/dsl/expression.rb:64:inaround' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-2.5.1/lib/glimmer/dsl/engine.rb:180:in
interpret_expression' from /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-2.5.1/lib/glimmer/dsl/engine.rb:65:inblock (2 levels) in <class:Engine>' from app/cryptopunks_gui.rb:33:in
create_gui' from app/cryptopunks_gui.rb:24:ininitialize' from app/cryptopunks_gui.rb:44:in
new' from app/cryptopunks_gui.rb:44:in<main>'
Looking forward to using the GUI.
If i can buy you a coffe im happy to donate some.
Looks like something with the tk library:
/Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/tk-0.4.0/lib/tk.rb:1981:in _invoke': couldn't recognize data in image file "/Users/jefsev/Local Sites/NFT-generator/CryptoPunkGUI/cryptopunkGui/cryptopunks-gui/icons/cryptopunks-gui.png" (RuntimeError)
The error is surprising. I don't get it.
You didn't tell me what platform you are running on yet. I assume you are on a Mac. If so, which Mac version? Catalina, Big Sur, Monterey, or another?
Could you also please confirm for me that you have a recent version of ActiveTcl like 8.6.9 ?
It looks like the Tk library is unable to load the image: /Users/jefsev/Local Sites/NFT-generator/CryptoPunkGUI/cryptopunkGui/cryptopunks-gui/icons/cryptopunks-gui.png
See if you can open the file yourself successfully just to make sure it is there. It has the logo of CryptoPunks GUI:
If the image works fine, then perhaps there is an issue in the code that is interacting with Tk.
In that case, open this file: /Users/jefsev/.rvm/rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/glimmer-dsl-tk-0.0.47/lib/glimmer/tk/widget_proxy.rb
Go to line 449, specifically:
the_image = ::TkPhotoImage.new(image_args)
Add require 'pd'; pd image_args; pd
in front of it to have it print out image information:
require 'pd'; pd image_args; pd the_image = ::TkPhotoImage.new(image_args)
Save the file, and re-run cryptopunks-gui
You should see output like this:
[PD] /Ruby30-x64/lib/ruby/gems/3.0.0/gems/glimmer-dsl-tk-0.0.47/lib/glimmer/tk/widget_proxy.rb:449
> require 'pd'; pd image_args; pd the_image = ::TkPhotoImage.new(image_args)
=> {
:file => "C:/Users/a_mal/code/cryptopunks-gui/icons/cryptopunks-gui.png"
}
[PD] /Ruby30-x64/lib/ruby/gems/3.0.0/gems/glimmer-dsl-tk-0.0.47/lib/glimmer/tk/widget_proxy.rb:449
> require 'pd'; pd image_args; pd the_image = ::TkPhotoImage.new(image_args)
=> #<TkPhotoImage:0x000002a85fc82e90 @type="photo", @path="i00000">
Please share output with me. It might have a clue to what is going wrong.
He, thx! im going to try this today. Ill let you know what happens. Running mac Cataline 10.15.7
Similar Issue
Mac Cataline 10.15.7 ActiveTcl-8.5
pixelart/1.2.1 on Ruby 3.0.2 (2021-07-07) [x86_64-darwin19] in (/Users/wangtao/.rvm/gems/ruby-3.0.2/gems/pixelart-1.2.1)
cryptopunks/2.0.1 on Ruby 3.0.2 (2021-07-07) [x86_64-darwin19] in (/Users/wangtao/.rvm/gems/ruby-3.0.2/gems/cryptopunks-2.0.1)
>ac39af4793119ee46bbff351d8cb6b5f23da60222126add4268e261199a2921b< SHA256 hash matching
✓ True Official Genuine CryptoPunks™ verified
2400x2400 (height x width)
/Users/wangtao/.rvm/gems/ruby-3.0.2/gems/tk-0.4.0/lib/tk.rb:1981:in `_invoke': couldn't recognize data in image file "/Users/wangtao/.rvm/gems/ruby-3.0.2/gems/cryptopunks-gui-0.0.15/icons/cryptopunks-gui.png" (RuntimeError)
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/tk-0.4.0/lib/tk.rb:1981:in `_ip_invoke_core'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/tk-0.4.0/lib/tk.rb:2016:in `_tk_call_core'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/tk-0.4.0/lib/tk.rb:2043:in `tk_call_without_enc'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/tk-0.4.0/lib/tk/image.rb:81:in `initialize'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/tk-0.4.0/lib/tk/image.rb:192:in `initialize'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/tk-0.4.0/lib/tk/image.rb:59:in `block (2 levels) in new'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/tk-0.4.0/lib/tk/image.rb:58:in `synchronize'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/tk-0.4.0/lib/tk/image.rb:58:in `block in new'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/tk-0.4.0/lib/tk/image.rb:57:in `instance_eval'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/tk-0.4.0/lib/tk/image.rb:57:in `new'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-dsl-tk-0.0.49/lib/glimmer/tk/widget_proxy.rb:449:in `image_argument'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-dsl-tk-0.0.49/lib/glimmer/tk/toplevel_proxy.rb:56:in `set_attribute'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-dsl-tk-0.0.49/lib/glimmer/dsl/tk/attribute_expression.rb:37:in `interpret'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-2.5.4/lib/glimmer/dsl/engine.rb:181:in `block in interpret_expression'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-2.5.4/lib/glimmer/dsl/expression.rb:64:in `around'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-2.5.4/lib/glimmer/dsl/engine.rb:180:in `interpret_expression'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-2.5.4/lib/glimmer/dsl/engine.rb:175:in `interpret'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-2.5.4/lib/glimmer.rb:78:in `method_missing'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/cryptopunks-gui-0.0.15/app/cryptopunks_gui.rb:35:in `block in create_gui'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-2.5.4/lib/glimmer/dsl/parent_expression.rb:32:in `add_content'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-dsl-tk-0.0.49/lib/glimmer/dsl/tk/root_expression.rb:45:in `add_content'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-2.5.4/lib/glimmer/dsl/engine.rb:199:in `add_content'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-2.5.4/lib/glimmer/dsl/engine.rb:182:in `block (2 levels) in interpret_expression'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/facets-3.1.0/lib/core/facets/kernel/tap.rb:19:in `tap'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-2.5.4/lib/glimmer/dsl/engine.rb:181:in `block in interpret_expression'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-2.5.4/lib/glimmer/dsl/expression.rb:64:in `around'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-2.5.4/lib/glimmer/dsl/engine.rb:180:in `interpret_expression'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/glimmer-2.5.4/lib/glimmer/dsl/engine.rb:65:in `block (2 levels) in <class:Engine>'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/cryptopunks-gui-0.0.15/app/cryptopunks_gui.rb:33:in `create_gui'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/cryptopunks-gui-0.0.15/app/cryptopunks_gui.rb:24:in `initialize'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/cryptopunks-gui-0.0.15/app/cryptopunks_gui.rb:44:in `new'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/cryptopunks-gui-0.0.15/app/cryptopunks_gui.rb:44:in `<top (required)>'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/cryptopunks-gui-0.0.15/bin/cryptopunks-gui:3:in `require_relative'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/gems/cryptopunks-gui-0.0.15/bin/cryptopunks-gui:3:in `<top (required)>'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/bin/cryptopunks-gui:23:in `load'
from /Users/wangtao/.rvm/gems/ruby-3.0.2/bin/cryptopunks-gui:23:in `<main>'
ActiveTcl 8.5 is old! I just updated the README with a specific version for ActiveTcl: 8.6. For example, I am running ActiveTcl version 8.6.9 successfully.
I also added more detailed prerequisite install instructions:
Mac:
\curl -sSL https://get.rvm.io | bash -s stable
(and run curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
if needed for mentioned security reasons)rvm install 3.0.2 --enable-shared --enable-pthread --with-tk --with-tcl
gem install tk -v0.4.0
Windows:
gem install tk -v0.4.0
Linux:
tar zxvf ActiveTcl-version-number.tar.gz
./ActiveTcl-version-number/install.sh
\curl -sSL https://get.rvm.io | bash -s stable
(and run curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
if needed for mentioned security reasons)rvm install 3.0.2 --enable-shared --enable-pthread --with-tk --with-tcl
gem install tk -v0.4.0
Hi, is this resolved?
He,
I tried to fix it myself but i'm not very proficient in Ruby
When i run ruby app/cryptopunks_gui.rb i get he following error:
/Users/jefsev/Local Sites/NFT-generator/CryptoPunkGUI/cryptopunks/app/model/image.rb:4:in
map': undefined methodname' for :BLUE_STOPS:Symbol (NoMethodError)
Let me know if i am doing something wrong and how i could fix this.Thx!