当我尝试 int integer = 1;
float floater =1.1111;
floater = integer;
时收到错误消息:
instanceof
这是我的gemfile:
angular.module('so', []);
angular.module('so')
.factory('UserFac', function() {
function UserFac(first, last) {
//--------^-- give it the factory name
this.name = first + ' ' + last
//-^-- use the object created internally using this keyword
}
return UserFac;
})
.controller('UserCtrl', function(UserFac) {
var user = new UserFac('John', 'Doe');
console.log(user instanceof UserFac)
});
我的capfile
bundle exec cap production deploy --trace
以及我的deploy.rb
deploy@h2540559:/www/apps/foodsoft$ bundle exec cap production deploy --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke rvm:hook (first_time)
** Execute rvm:hook
cap aborted!
NoMethodError: undefined method `on' for main:Object
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/capistrano-rvm-0.1.2/lib/capistrano/tasks/rvm.rake:17:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb:248:in `call'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb:248:in `block in execute'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb:243:in `each'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb:243:in `execute'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb:187:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb:180:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb:173:in `invoke'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/capistrano-3.2.1/lib/capistrano/dsl/task_enhancements.rb:12:in `block in after'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb:248:in `call'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb:248:in `block in execute'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb:243:in `each'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb:243:in `execute'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb:187:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb:180:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/task.rb:173:in `invoke'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/application.rb:150:in `invoke_task'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/application.rb:106:in `each'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/application.rb:106:in `block in top_level'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/application.rb:115:in `run_with_threads'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/application.rb:100:in `top_level'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/application.rb:78:in `block in run'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/application.rb:176:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/rake-11.1.1/lib/rake/application.rb:75:in `run'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/capistrano-3.2.1/lib/capistrano/application.rb:15:in `run'
/usr/local/rvm/gems/ruby-2.0.0-p643/gems/capistrano-3.2.1/bin/cap:3:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.0.0-p643/bin/cap:23:in `load'
/usr/local/rvm/gems/ruby-2.0.0-p643/bin/cap:23:in `<main>'
/usr/local/rvm/gems/ruby-2.0.0-p643/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.0.0-p643/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => rvm:hook
有谁知道如何解决这个问题?
非常感谢, 全型
答案 0 :(得分:39)
在运行捆绑更新之后我刚才遇到了同样的错误,没有更新主要版本,除了Rake到11之外。从capistrano 3.2.1升级到3.4.0为我修复了它!
答案 1 :(得分:1)
我有同样的错误。
我的capistrano版本是3.1.0,rails版本是4.1.4。 但是我的同事没有这个问题。我尝试将红宝石版本,rvm版本更改为与同事的配置相同。它仍然无法正常工作。 因此,我尝试列出所有这些相关的宝石。我发现我的sshkit比他的高。
所以我将sshkit降级到1.7.1。
然后它起作用。