railroad problem

S

srinivasan.anand

=20

Hi all,

Got struck up with this. Please help.

=20

The actual requirement is that I am trying to generate a model diagram
thru the railroad which I have installed in my machine. I use both
oracle and postgre db's in the db connection (database.yml file).=20

=20

"puredisk_development:

adapter: postgresql

database: ca

port: 10085

username: ***

password: ***

=20

reporting_development:

adapter: oracle

username: ***

password: ***

database: ***

"

=20

The error which I am getting when I am running the command "railroad -M
-v -o models" is=20

=20

/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support
/dependencies.rb:249:in `load_missing_constant': Expected
config/../app/models/pd.rb to define Pd (LoadError)

from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support
/dependencies.rb:452:in `const_missing'

from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support
/dependencies.rb:464:in `const_missing'

from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support
/inflector.rb:250:in `constantize'

from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support
/core_ext/string/inflections.rb:148:in `constantize'

from
/usr/local/lib/ruby/gems/1.8/gems/railroad-0.4.0/lib/railroad/models_dia
gram.rb:25:in `generate'

from
/usr/local/lib/ruby/gems/1.8/gems/railroad-0.4.0/lib/railroad/models_dia
gram.rb:24:in `each'

from
/usr/local/lib/ruby/gems/1.8/gems/railroad-0.4.0/lib/railroad/models_dia
gram.rb:24:in `generate'

from
/usr/local/lib/ruby/gems/1.8/gems/railroad-0.4.0/bin/railroad:40

from /usr/local/bin/railroad:16:in `load'

from /usr/local/bin/railroad:16

=20

=20

This "pd.rb" in the error uses the postgre db conection.

The contents of the pd.rb file are=20

=20

"

class PD < ActiveRecord::Base

connection =3D "puredisk_#{ENV['RAILS_ENV']}"

establish_connection connection.to_sym

end

=20

class PD::policy < PD; set_table_name 'policy'; end

class PD::Dsinpolicies < PD; set_table_name 'dsinpolicies'; end

class PD::Dataselection < PD; set_table_name 'dataselection'; end

class PD::Agent < PD; set_table_name 'agent'; end

class PD::Job < PD; set_table_name 'job'; end

class PD::policyrun < PD; set_table_name 'policyrun'; end

class PD::Dstemplate < PD; set_table_name 'dataselectiontemplate'; end

class PD::policytype < PD; set_table_name 'policytype'; end

"

=20

And the rails_env is "development"

=20

Thanks in advance ..

=20

Regards,

Anand.

=20

=20

=20

=20

=20

=20

=20

=20

=20

=20



This message is for the designated recipient only and may contain =
privileged, proprietary, or otherwise private information. If you have =
received it in error, please notify the sender immediately and delete =
the original. Any other use of the email by you is prohibited.
 
M

Mohit Sindhwani

Hi all,

Got struck up with this. Please help.



The actual requirement is that I am trying to generate a model diagram
thru the railroad which I have installed in my machine. I use both
oracle and postgre db's in the db connection (database.yml file).



"puredisk_development:

adapter: postgresql

database: ca

port: 10085

username: ***

password: ***



reporting_development:

adapter: oracle

username: ***

password: ***

database: ***

"



This "pd.rb" in the error uses the postgre db conection.

The contents of the pd.rb file are



"

class PD < ActiveRecord::Base

connection = "puredisk_#{ENV['RAILS_ENV']}"

establish_connection connection.to_sym

end

Do you have an environment called 'development' in database.yml? It
seems you have reporting_development and puredisk_development but not
development.

That said, I think for one of my projects, I had some problems with
railroad trying to resolve class name because my file names didn't seem
to match the convention... I think my table was called TTFiles and my
model was TtFile and the file name was tt_file.rb - and it all didn't
add up to Railroad properly at that time. I don't know if the problem
you are seeing is because it expects your class to be Pd (not PD)?

Hope this helps.

Cheers,
Mohit.
11/16/2007 | 10:51 PM.
 
S

steffen_kory

It looks like it is looking for a class called Pd and not PD.

Try "class Pd < ActiveRecord::Base".


Hi all,

Got struck up with this. Please help.

The actual requirement is that I am trying to generate a model
diagram thru the railroad which I have installed in my machine. I
use both oracle and postgre db's in the db connection (database.yml
file).

"puredisk_development:

adapter: postgresql

database: ca

port: 10085

username: ***

password: ***

reporting_development:

adapter: oracle

username: ***

password: ***

database: ***

"

The error which I am getting when I am running the command "railroad
-M -v -o models" is

/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support
/dependencies.rb:249:in `load_missing_constant': Expected
config/../app/models/pd.rb to define Pd (LoadError)

from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support
/dependencies.rb:452:in `const_missing'

from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support
/dependencies.rb:464:in `const_missing'

from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support
/inflector.rb:250:in `constantize'

from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support
/core_ext/string/inflections.rb:148:in `constantize'

from
/usr/local/lib/ruby/gems/1.8/gems/railroad-0.4.0/lib/railroad/models_dia
gram.rb:25:in `generate'

from
/usr/local/lib/ruby/gems/1.8/gems/railroad-0.4.0/lib/railroad/models_dia
gram.rb:24:in `each'

from
/usr/local/lib/ruby/gems/1.8/gems/railroad-0.4.0/lib/railroad/models_dia
gram.rb:24:in `generate'

from
/usr/local/lib/ruby/gems/1.8/gems/railroad-0.4.0/bin/railroad:40

from /usr/local/bin/railroad:16:in `load'

from /usr/local/bin/railroad:16

This "pd.rb" in the error uses the postgre db conection.

The contents of the pd.rb file are

"

class PD < ActiveRecord::Base

connection = "puredisk_#{ENV['RAILS_ENV']}"

establish_connection connection.to_sym

end

class PD::policy < PD; set_table_name 'policy'; end

class PD::Dsinpolicies < PD; set_table_name 'dsinpolicies'; end

class PD::Dataselection < PD; set_table_name 'dataselection'; end

class PD::Agent < PD; set_table_name 'agent'; end

class PD::Job < PD; set_table_name 'job'; end

class PD::policyrun < PD; set_table_name 'policyrun'; end

class PD::Dstemplate < PD; set_table_name 'dataselectiontemplate'; end

class PD::policytype < PD; set_table_name 'policytype'; end

"

And the rails_env is "development"

Thanks in advance ..

Regards,

Anand.

This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you
have received it in error, please notify the sender immediately and
delete the original. Any other use of the email by you is prohibited.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top