linux – Capistrano部署的精神错误
发布时间:2020-12-14 01:43:04 所属栏目:Linux 来源:网络整理
导读:我有一个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::S
我有一个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'. 我发现类似问题here并假设这个警告实际上是心理崩溃的原因.但我无法摆脱它,PATH实际上对我来说很好,当我通过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_profile
所以,我在deployment.rb中加载了一个bash作为默认shell: default_run_options[:shell] = '/bin/bash' 然后将.bash_profile的RVM加载脚本移动到.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* (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- linux – Postfix:将所有传入邮件中继到另一台主机
- linux – 如何通过puppet安全地禁用用户密码?
- 从Linux 与 Unix 异同,看开源世界的发展!
- networking – linux命令通过使用netstat和iptables来防止d
- linux-kernel – 如何在/ proc / meminfo中计算MemTotal
- 内核可以在Linux中使用虚拟内存
- 工具杂记(一) -- vagrant
- linux – kill -3实际上终止了一个java进程吗?或者只是生成
- linux – 使用“ip”命令在CentOS / RHEL 6中重新启动时保留
- lvm – ext3快照支持
推荐文章
站长推荐
热点阅读