[wxruby-users] DatePickerCtrl uninitialized constant

Svend Haugaard Sørensen
Fri, 06 Nov 2009 10:07:12 -0000

On Fri, 6 Nov 2009 02:40:47 -0500
Mario Steele <mario at ruby-im.net> wrote:

> Hello Svend,
>
> 2009/11/5 Svend Haugaard S?rensen <shs at demosophia.net>
>
> > I trying to make a Dialog that include a DatePickerCtrl on my gentoo
> > linux box.
> >
> > I get the following error
> >
> >
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:478:in
> > `const_missing'': uninitialized constant
> > PortfolioDialog::DatePickerCtrl (NameError)
> >
> > My application use ActiveRecord, thats why the error is from
> > activesupport.
> >
> > gem list says
> > wxruby (1.9.9, 1.9.8)
> >
>
> 1.9.8 and 1.9.9 are old versions, you should use 2.0.1, as it is the
> newest, however the wxDatePickerCtrl is in 1.9.9 and 1.9.8.  The
> problem is, is that ActiveSupport is trying to check for a Constant,
> that does not exist.  You need to use Wx::DatePickerCtrl in order to
> make it work, unless you include Wx in PortfolioDialog class.
>
I have have a ''include Wx'' just after ''require
"wx"'' in my program.

If I use @buy_date=Wx::DatePickerCtrl.new(self,-1)
the error change to

 /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:263:in
`load_missing_constant'': uninitialized constant Wxruby2::DatePickerCtrl
(NameError)

I tried to make a ''gem update wxruby'' and that installed the
1.9.9
version. And it didn''t remove the error.