我有Padrino项目使用Erb作为模板引擎,Mongoid作为Object-Document-Mapper。
我正在尝试按照命令
为我的Padrino项目创建管理员应用程序padrino g admin -e erb
但我收到错误
/home/vadim/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:297:in `initialize': No such file or directory - /home/vadim/projects/interierka/heroku/.components (Errno::ENOENT)
from /home/vadim/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:297:in `open'
from /home/vadim/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:297:in `load_file'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/padrino-gen-0.10.7/lib/padrino-gen/generators/actions.rb:120:in `retrieve_component_config'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/padrino-gen-0.10.7/lib/padrino-gen/generators/actions.rb:101:in `store_component_choice'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/padrino-admin-0.10.7/lib/padrino-admin/generators/admin_app.rb:53:in `create_admin'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/task.rb:27:in `run'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `block in invoke_all'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `each'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `map'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `invoke_all'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/group.rb:238:in `dispatch'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/base.rb:425:in `start'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/padrino-gen-0.10.7/lib/padrino-gen/generators/cli.rb:51:in `setup'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/task.rb:27:in `run'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `block in invoke_all'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `each'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `map'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `invoke_all'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/group.rb:238:in `dispatch'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/base.rb:425:in `start'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/padrino-gen-0.10.7/bin/padrino-gen:16:in `<main>'
我正在尝试创建.components文件,但发生了另一个错误
/home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/padrino-gen-0.10.7/lib/padrino-gen/generators/actions.rb:102:in `store_component_choice': undefined method `[]=' for false:FalseClass (NoMethodError)
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/padrino-admin-0.10.7/lib/padrino-admin/generators/admin_app.rb:53:in `create_admin'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/task.rb:27:in `run'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `block in invoke_all'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `each'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `map'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `invoke_all'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/group.rb:238:in `dispatch'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/base.rb:425:in `start'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/padrino-gen-0.10.7/lib/padrino-gen/generators/cli.rb:51:in `setup'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/task.rb:27:in `run'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:120:in `invoke_task'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `block in invoke_all'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `each'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `map'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/invocation.rb:126:in `invoke_all'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/group.rb:238:in `dispatch'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.15.4/lib/thor/base.rb:425:in `start'
from /home/vadim/.rvm/gems/ruby-1.9.3-p194/gems/padrino-gen-0.10.7/bin/padrino-gen:16:in `<main>'
答案 0 :(得分:0)
错误是由于我将项目文件移动到另一个文件夹,忘记了。*文件。
.components文件是在创建Padrino项目时创建的,包含有关项目中使用的组件的信息。
我的.components文件的内容:
---
:orm: mongoid
:test: none
:mock: none
:script: jquery
:renderer: erb
:stylesheet: none