rails g脚手架!在开发环境中未初始化的常量

时间:2013-05-14 04:54:47

标签: ruby-on-rails ubuntu gem rake rails-postgresql

我使用postgresql数据库在ubuntu 10.04上设置了我的ror开发环境。我得到了一个测试来生成一个脚手架:

<module:AppName>: uninitialized constant AppName::Rails::Application (NameError)

from /home/main/rails_app/appname/config/application.rb:12:in '<top (required)>'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:24:in 'require'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:24:in '<top (required)>'
from script/rails:6:in 'require'
from script/rails:6:in '<main>'

并且宝石列表如下

actionmailer (3.2.13)
actionpack (3.2.13)
activemodel (3.2.13)
activerecord (3.2.13)
activeresource (3.2.13)
activesupport (3.2.13)
arel (3.0.2)
bigdecimal (1.1.0)
builder (3.0.4)
bundler (1.3.5)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.6.2)
erubis (2.7.0)
execjs (1.4.0)
hike (1.2.2)
i18n (0.6.1)
io-console (0.3)
journey (1.0.4)
jquery-rails (2.2.1)
json (1.8.0, 1.5.4)
mail (2.5.3)
mime-types (1.23)
minitest (2.5.1)
multi_json (1.7.3)
pg (0.15.1)
polyglot (0.3.3)
rack (1.4.5)
rack-cache (1.2)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (3.2.13)
railties (3.2.13)
rake (10.0.4)
rdoc (3.12.2, 3.9.4)
sass (3.2.9)
sass-rails (3.2.6)
sprockets (2.2.2)
thor (0.18.1)
tilt (1.4.1)
treetop (1.4.12)
tzinfo (0.3.37)
uglifier (2.1.0)

我记得在使用require rake/dsl_definition编辑rakefile的地方遇到了类似的错误,但是这次它没有用,我很乖“

我通过谷歌搜索没有运气,并想知道是否有人能指出我正确的方向。

调用rake也会给你类似的错误

编辑:

我尝试了一个新创建的数据库用户的另一个新项目,实际上得到了这个

    connection_adapters/postgresql_adapter.rb:1216:in `initialize': FATAL:  Ident authentication failed for user "blog" (PG::Error)
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `new'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `connect'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:324:in `initialize'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/railtie.rb:88:in `block in <class:Railtie>'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/daniel/rails_app/blog/config/environment.rb:5:in `<top (required)>'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:103:in `require'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:103:in `require_environment!'
from /root/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:25:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

0 个答案:

没有答案