Skip to content

Instantly share code, notes, and snippets.

@bosko
bosko / gist:967268
Created May 11, 2011 20:28
Runtime Tk error
d:\projects\ruby\rubyinstaller\sandbox>ruby ..\..\ruby-git\ext\tk\sample\24hr_clock.rb
FindResource() failed for buttons bitmap resource, resources in tk_base.rc must be linked into Tk dll or static executable
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
@bosko
bosko / gist:975222
Created May 16, 2011 20:00
Tcl/Tk results
d:\projects>set PATH=c:\Ruby\ruby193_tcltk\bin;%PATH%
d:\projects>ruby -v
ruby 1.9.3dev (2011-05-14 trunk 31568) [i386-mingw32]
d:\projects>ruby -rtk -e "puts Tk::TK_PATCHLEVEL"
8.5.9
d:\projects>set PATH=c:\Ruby\ruby19_tcltk\bin;%PATH%
@bosko
bosko / gist:977049
Created May 17, 2011 18:25
Emacs recursive grep filtered by file extension
grep -nH -ir --include=*.{ext1,ext2} -e "" ../*
@bosko
bosko / gist:989617
Created May 24, 2011 20:42
Options for new Tcl/Tk extconf
diff --git a/recipes/interpreter/ruby19.rake b/recipes/interpreter/ruby19.rake
index a453246..8fe982a 100644
--- a/recipes/interpreter/ruby19.rake
+++ b/recipes/interpreter/ruby19.rake
@@ -108,6 +108,8 @@ namespace(:interpreter) do
puts "Adding Tcl/Tk dirs..."
package.configure_options << "--with-tcl-dir=#{File.join(RubyInstaller::ROOT, RubyInstaller::Tcl.install_target)}"
package.configure_options << "--with-tk-dir=#{File.join(RubyInstaller::ROOT, RubyInstaller::Tk.install_target)}"
+ package.configure_options << "--with-tklib=tk85-ri"
+ package.configure_options << "--with-tcllib=tcl85-ri"
@bosko
bosko / gist:1001928
Created June 1, 2011 07:32
Installing error
installing default gems: d:/projects/ruby/rubyinstaller/sandbox/ruby19_mingw/lib/ruby/gems/1.9.1
d:/projects/ruby/ruby-git/lib/fileutils.rb:1508:in `path': can't convert nil into String (TypeError)
from d:/projects/ruby/ruby-git/lib/fileutils.rb:1508:in `block in fu_list'
from d:/projects/ruby/ruby-git/lib/fileutils.rb:1508:in `map'
from d:/projects/ruby/ruby-git/lib/fileutils.rb:1508:in `fu_list'
from ../../../ruby-git/tool/rbinstall.rb:174:in `makedirs'
from ../../../ruby-git/tool/rbinstall.rb:284:in `prepare'
from ../../../ruby-git/tool/rbinstall.rb:543:in `block in <main>'
from ../../../ruby-git/tool/rbinstall.rb:584:in `call'
from ../../../ruby-git/tool/rbinstall.rb:584:in `block (2 levels) in <main>'
@bosko
bosko / gist:1011979
Created June 7, 2011 10:03
Error running sqlserver adapter tests
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from d:/projects/ruby/rails/load_paths.rb:3.
Using SQLServer via DBLIB to localhost
* DEFERRED: For abstract behavior with different language should do a date insertion when language is german.
d:/projects/ruby/rails/activesupport/lib/active_support/dependencies.rb:237:in `require': no such file to load -- d:/projects/ruby/activerecord-sqlserver-adapter/[] (LoadError)
from d:/projects/ruby/rails/activesupport/lib/active_support/dependencies.rb:237:in `block in require'
from d:/projects/ruby/rails/activesupport/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from d:/projects/ruby/rails/activesupport/lib/active_support/dependencies.rb:639:in `new_constants_in'
from d:/projects/ruby/rails/activesupport/lib/active_support/dependencies.rb:223:in `load_dependency'
from d:/projects/ruby/rails/activesupport/lib/active_support/depende
@bosko
bosko / tcltklib.c.diff
Created June 18, 2011 10:40
Set tcl_library to the value of system variable
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index 8701cfe..b058443 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -5614,6 +5614,7 @@ ip_init(argc, argv, self)
/* from Tcl_AppInit() */
DUMP1("Tcl_Init");
+ Tcl_SetVar(ptr->ip, "tcl_library", getenv("TCL_LIBRARY"), TCL_GLOBAL_ONLY);
if (Tcl_Init(ptr->ip) == TCL_ERROR) {
@bosko
bosko / calendar.rb
Created February 7, 2012 21:51
API v3 snippets
require 'google_suite/oauth/calendar_oauth'
require 'google_suite/oauth/calendar_oauth2'
class Calendar < Scope
# At this moment we must know what is version of API
# that we are created for. In other words client must already
# be created before any of "data" classes are used
case GoogleSuite.client.api_version
when "2.0"
include(GoogleSuite::CalendarOAuth)
@bosko
bosko / gist:2988529
Created June 25, 2012 13:21
Ruby tests error
D:/projects/ruby/ruby-git/test/syslog/test_syslog_logger.rb: cannot load such file -- syslog/logger (LoadError)
D:/projects/ruby/ruby-git/lib/test/unit.rb:534:in `load': undefined class/module WIN32OLERuntimeError (ArgumentError)
from D:/projects/ruby/ruby-git/lib/test/unit.rb:534:in `block in _run_parallel'
from D:/projects/ruby/ruby-git/lib/test/unit.rb:503:in `each'
from D:/projects/ruby/ruby-git/lib/test/unit.rb:503:in `_run_parallel'
from D:/projects/ruby/ruby-git/lib/test/unit.rb:651:in `_run_suites'
from D:/projects/ruby/ruby-git/lib/minitest/unit.rb:792:in `_run_anything'
from D:/projects/ruby/ruby-git/lib/minitest/unit.rb:981:in `run_tests'
from D:/projects/ruby/ruby-git/lib/minitest/unit.rb:968:in `block in _run'
@bosko
bosko / gist:2994133
Created June 26, 2012 07:33
Ruby 'make test-all' errors with chcp 65001
# Running tests:
[ 611/11297] OpenSSL::TestConfig#test_constants = 0.00 s
1) Failure:
test_constants(OpenSSL::TestConfig) [D:/projects/ruby/ruby-git/test/openssl/test_config.rb:22]:
Exception raised:
<#<Errno::ENOENT: No such file or directory - C:/Users/Luis/Projects/oss/knapsack.old/knap-build/var/knapsack/software/x86-windows/openssl/1.0.0j/ssl/openssl.cnf>>.
[ 3179/11297] TestDir_M17N#test_filename_euc_jp = 0.14 s
2) Failure: