Forum: Ruby on Rails Problem using generate/scaffold and FireRuby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mocte (Guest)
on 2006-04-11 19:22
Hi to all,

I am trying to use "ruby script/generate scaffold product". I always get
the message "uninitialized constant CHARACTER_SET". I have a products
table in a Firebird database called depot_development.fdb. Here is my
config file :

> common: &common
>    adapter: firebird
>    host: localhost
>    username: SYSDBA
>    password: masterkey
>    charset: WIN1252
>
> development:
>    database: depot_development
>    <<: *common
>
> production:
>    database: depot_production
>    <<: *common
>
> test:
>    database: depot_test
>    <<: *common
>
> and my firebird's aliases.conf
>
> depot_development = C:\Sistemas\Ruby\db\depot_development.fdb
> depot_production  = C:\Sistemas\Ruby\db\depot_production.fdb
> depot_test        = C:\Sistemas\Ruby\db\depot_test.fdb
>

Running on WinXP SP2, Firebird 1.5.3, FireRuby 0.4.1, here are the
details of the script:

ruby script/generate scaffold product admin -t
>       exists  app/controllers/
>       exists  app/helpers/
>       create  app/views/admin
>       create  test/functional/
>   dependency  model
>       create    app/models/
>       create    test/unit/
>       create    test/fixtures/
>       create    app/models/product.rb
>       create    test/unit/product_test.rb
>       create    test/fixtures/products.yml
> uninitialized constant CHARACTER_SET
>
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/
> depend
> encies.rb:123:in `const_missing'
>
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/
> depend encies.rb:131:in `const_missing_before_generators'
>
> c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/rails_generator/lookup.rb:13:
> in `const_missing'
>
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/
> depend encies.rb:133:in `const_missing_before_generators'
>
> c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/rails_generator/lookup.rb:13:
> in `const_missing'
>
> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/c
> onnect ion_adapters/firebird_adapter.rb:33:in `firebird_connection'
>
> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/c
> onnect ion_adapters/abstract/connection_specification.rb:251:in
> `connection_without_query_cache='
>
> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/q
> uery_c
> ache.rb:54:in `connection='
>
> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/c
> onnect ion_adapters/abstract/connection_specification.rb:220:in
> `retrieve_connection'
>
> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/c
> onnect ion_adapters/abstract/connection_specification.rb:78:in
> `connection'
>
> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/b
> ase.rb
> :696:in `columns'
>
> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/b
> ase.rb :1969:in `attributes_from_column_definition'
>
> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/b
> ase.rb :1351:in `initialize_without_callbacks'
>
> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/c
> allbac
> ks.rb:236:in `initialize'
>
> c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/rails_generator/generat
> ors/co mponents/scaffold/scaffold_generator.rb:182:in `model_instance'
>
> c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/rails_generator/generat
> ors/co mponents/scaffold/scaffold_generator.rb:164:in `create_sandbox'
>
> c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/rails_generator/generat
> ors/co mponents/scaffold/scaffold_generator.rb:85:in `manifest'
>
> c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/rails_generator/command
> s.rb:1
> 06:in `render_template_part'
>
> c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/rails_generator/command
> s.rb:2
> 84:in `complex_template'
>
> c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/rails_generator/manifes
> t.rb:4
> 7:in `send_actions'
>
> c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/rails_generator/manifes
> t.rb:4
> 6:in `send_actions'
>
> c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/rails_generator/manifes
> t.rb:3
> 1:in `replay'
>
> c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/rails_generator/command
> s.rb:4
> 1:in `invoke!'
>
> c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/rails_generator/scripts
> /../sc
> ripts.rb:31:in `run'
>   c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/generate.rb:6
>   c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
>
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/
> depend
> encies.rb:147:in `require'
>   ./script/generate:3
>   -e:3

I've read a thread before i this forum and the solution was to upgrade
firebird 1.5.2 to 1.5.3 when I found this I've checked my FB version and
realized I have 1.5.2 so I've upgraded to 1.5.3 without any changes, I
also tried to use the physical path to the database instead of the alias
in the config file, without success, I'm completely new to ruby, so I
don't know what else to do, I can succesfully run the
C:\ruby\lib\ruby\gems\1.8\gems\fireruby-0.4.1-mswin32\examples\example01.rb,
but  I can't go anywhere with "script/generate scaffold".

Any hints ?

Thanks in advance
Mocte
This topic is locked and can not be replied to.