使用capistrano部署Sinatra Application时未定义的方法'strip'

时间:2011-04-15 14:02:00

标签: ruby sinatra capistrano

运行cap deploy时出现了一个奇怪的错误:setup:

cap deploy:setup  
Using ActiveModel validations.  
Validations included SimpleRecord::Base  
New Aws::SdbInterface using per_thread-connection mode  
New Aws::S3Interface using per_thread-connection mode  
/Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/command.rb:24:in `initialize': undefined method `strip' for Sinatra::Application:Class (NoMethodError)  
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/command.rb:109:in `new'  
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/command.rb:109:in `else'  
from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/actions/invocation.rb:144:in `block in run'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/command.rb:101:in `initialize'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/actions/invocation.rb:144:in `new'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/actions/invocation.rb:144:in `run'  
    from Capfile:9:in `load'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/loading.rb:93:in `instance_eval'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/loading.rb:93:in `load'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/loading.rb:172:in `load_from_file'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/loading.rb:89:in `load'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/loading.rb:86:in `block in load'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/loading.rb:86:in `each'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/configuration/loading.rb:86:in `load'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/cli/execute.rb:65:in `each'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/cli/execute.rb:65:in `load_recipes'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/cli/execute.rb:31:in `execute!'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/lib/capistrano/cli/execute.rb:14:in `execute'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/gems/capistrano-2.5.21/bin/cap:4:in `<top (required)>'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/bin/cap:19:in `load'  
    from /Users/myusername/.rvm/gems/ruby-1.9.2-p136@sinatra/bin/cap:19:in `<main>'  

有关如何解决此问题的任何想法?

1 个答案:

答案 0 :(得分:0)

事实证明,MyApp.rb实际上没有定义类MyApp。我补充说:    class MyApp&lt;西纳特拉::基地 该错误现已清除。