我最近安装了green_shoes gem,遇到了一个有趣的问题。我去运行示例应用程序,sam.rb:
require 'green_shoes'
Shoes.app { para "welcome!" }
我得到一个类似的错误
/Users/me/.rvm/gems/ruby-2.2.0/gems/green_shoes-1.1.374/lib/shoes/app.rb:145:in `show_page': out of memory (NoMemoryError)
from /Users/me/.rvm/gems/ruby-2.2.0/gems/green_shoes-1.1.374/lib/shoes/app.rb:145:in `textblock'
from /Users/me/.rvm/gems/ruby-2.2.0/gems/green_shoes-1.1.374/lib/shoes/app.rb:168:in `para'
from /Users/me/.rvm/gems/ruby-2.2.0/gems/green_shoes-1.1.374/lib/shoes/style.rb:58:in `style'
from /Users/me/.rvm/gems/ruby-2.2.0/gems/green_shoes-1.1.374/lib/shoes/basic.rb:222:in `text='
from /Users/me/.rvm/gems/ruby-2.2.0/gems/green_shoes-1.1.374/lib/shoes/basic.rb:228:in `positioning'
from /Users/me/.rvm/gems/ruby-2.2.0/gems/green_shoes-1.1.374/lib/shoes/helper_methods.rb:179:in `block in contents_alignment'
from /Users/me/.rvm/gems/ruby-2.2.0/gems/green_shoes-1.1.374/lib/shoes/helper_methods.rb:168:in `each'
from /Users/me/.rvm/gems/ruby-2.2.0/gems/green_shoes-1.1.374/lib/shoes/helper_methods.rb:168:in `contents_alignment'
from /Users/me/.rvm/gems/ruby-2.2.0/gems/green_shoes-1.1.374/lib/shoes/helper_methods.rb:220:in `call_back_procs'
from /Users/me/.rvm/gems/ruby-2.2.0/gems/green_shoes-1.1.374/lib/shoes/main.rb:119:in `app'
from sam.rb:3:in `<main>'
不过,真正令人兴奋的是,除了文本,我似乎在渲染任何东西时都没有任何问题。有什么想法吗?任何帮助都将不胜感激。下面是我的宝石清单,只是为了以防万一的问题
*** LOCAL GEMS ***
actionmailer (4.2.1, 4.2.0)
actionpack (4.2.1, 4.2.0)
actionview (4.2.1, 4.2.0)
activejob (4.2.1, 4.2.0)
activemodel (4.2.1, 4.2.0)
activerecord (4.2.1, 4.2.0)
activesupport (4.2.1, 4.2.0)
arel (6.0.0)
atk (2.2.4)
bigdecimal (1.2.7, 1.2.6)
binding_of_caller (0.7.2)
builder (3.2.2)
bundler (1.9.4, 1.8.4)
bundler-unload (1.0.2)
byebug (4.0.5, 3.5.1)
cairo (1.14.1)
climate_control (0.0.3)
cocaine (0.5.7)
coffee-rails (4.1.0)
coffee-script (2.4.1, 2.3.0)
coffee-script-source (1.9.1.1, 1.9.1)
columnize (0.9.0)
debug_inspector (0.0.2)
debugger-linecache (1.2.0)
diff-lcs (1.2.5)
erubis (2.7.0)
execjs (2.5.2, 2.4.0)
executable-hooks (1.3.2)
gdk_pixbuf2 (2.2.4)
gem-wrappers (1.2.7)
glib2 (2.2.4)
globalid (0.3.5, 0.3.3)
green_shoes (1.1.374)
gtk2 (2.2.4)
hike (2.1.3, 1.2.3)
i18n (0.7.0)
io-console (0.4.3)
jbuilder (2.2.13, 2.2.12, 2.2.11)
jquery-rails (4.0.3)
json (1.8.2, 1.8.1)
loofah (2.0.1)
mail (2.6.3)
mime-types (2.4.3)
mini_portile (0.6.2)
minitest (5.6.0, 5.5.1, 5.4.3)
multi_json (1.11.0)
nokogiri (1.6.6.2)
pango (2.2.4)
paperclip (4.2.1)
pkg-config (1.1.6)
power_assert (0.2.3, 0.2.2)
psych (2.0.13, 2.0.8)
rack (1.6.0)
rack-test (0.6.3)
rails (4.2.1, 4.2.0)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.6, 1.0.5)
rails-html-sanitizer (1.0.2, 1.0.1)
railties (4.2.1, 4.2.0)
rake (10.4.2)
rdoc (4.2.0)
rspec (3.2.0)
rspec-core (3.2.3, 3.2.2, 2.14.8)
rspec-expectations (3.2.1, 3.2.0, 2.14.5)
rspec-mocks (3.2.1, 2.14.6)
rspec-support (3.2.2)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)
sass (3.4.13)
sass-rails (5.0.3, 5.0.1)
sdoc (0.4.1)
slop (4.1.0, 3.6.0)
spring (1.3.4, 1.3.3)
sprockets (3.0.1, 2.12.3)
sprockets-rails (2.2.4)
sqlite3 (1.3.10)
test-unit (3.0.9, 3.0.8)
thor (0.19.1)
thread_safe (0.3.5, 0.3.4)
tilt (2.0.1, 1.4.1)
turbolinks (2.5.3)
tzinfo (1.2.2)
uglifier (2.7.1)
web-console (2.1.2, 2.1.1)
为使用这个漂亮的小GUI竖起大拇指。
当我更新其中一个依赖项时,我也遇到了各种各样的问题。我想你的问题是GTK-gem,我使用gtk2 (1.1.2 x86-mingw32)
和cairo (1.10.2 x86-mingw32)
。
你的样品在这里很好用。虽然我使用Ruby 1.9.3,但在2.X上我没有绿色鞋子的经验。
遗憾的是,green_shoes目前尚未维护,因此像这样的错误不太可能得到修复。由于所有的鞋子版本都有一定的兼容性,你可以试试你的运气跑鞋4或鞋子3.2