Linux Capistrano部署时出现心理错误

Linux Capistrano部署时出现心理错误,linux,ruby-on-rails-3,ubuntu,deployment,capistrano,Linux,Ruby On Rails 3,Ubuntu,Deployment,Capistrano,我有一个Capistrano部署脚本,它已经工作了一段时间,但现在它在部署时抛出这样的错误: /Users/lifecoder/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): control characters are not allowed at line 1 column 1 (Psych::SyntaxError) from /Users/lifecode

我有一个Capistrano部署脚本,它已经工作了一段时间,但现在它在部署时抛出这样的错误:

/Users/lifecoder/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): control characters are not allowed at line 1 column 1 (Psych::SyntaxError)
    from /Users/lifecoder/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
    from /Users/lifecoder/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/psych.rb:151:in `parse'
    from /Users/lifecoder/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/psych.rb:127:in `load'
...
 ** [out :: test.domain] Warning! PATH is not properly set up, '/home/lifecoder/.rvm/gems/ruby-1.9.3-p448/bin' is not at first place,
 ** [out :: test.domain]
 ** [out :: test.domain] usually this is caused by shell initialization files - check them for 'PATH=...' entries,
 ** [out :: test.domain]
 ** [out :: test.domain] to fix run: 'rvm use ruby-1.9.3-p448'.
我发现了类似的问题,并假设这个警告实际上是精神崩溃的原因。但我无法摆脱它,路径实际上对我来说很好,当我通过ssh连接并检查它时,rvm首先是

$ echo $PATH
/home/lifecoder/.rvm/gems/ruby-1.9.3-p448/bin:/home/lifecoder/.rvm/gems/ruby-1.9.3-p448@global/bin:/home/lifecoder/.rvm/rubies/ruby-1.9.3-p448/bin:/home/lifecoder/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
我不太精通*nix,所以我可能错过了一些东西——但找不到确切的东西

我知道这可能是可以通过YAML解析器引擎更改来修复的,或者通过删除某个地方的YAML文件来修复的,这样Psych就不会启动,但我更愿意以正确的方式修复这个问题

UPD1:我在Capistrano脚本中添加了一个带有“use rvm”的钩子,它返回我“rvm不是函数”。似乎它没有加载bashrc/其他init脚本


UPD2:是的,它不会加载bash,但是当我启用bash时,它会变得更糟。作为临时解决方案,我禁用了capistrano/assets。看来我所需要的就是擦除复制粘贴的capistrano脚本,然后从头重写它

当Capistrano登录时-它使用非交互式shell-它不加载.bash\u配置文件 因此,我在部署.rb中加载了一个bash作为默认shell:

default_run_options[:shell] = '/bin/bash'
然后将RVM加载脚本从.bash_profile移动到.bashrc

#.bash_profile
source ~/.bashrc



#.bashrc
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*