- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
请看下面的错误(control characters are not allowed at line 1 column 1 (Psych::SyntaxError))并帮助我解决它。当我尝试在Ubuntu 12.10 ruby 1.9.3 Rails 3.2.0。有用于部署的本地 Apache 服务器。
我在 stackoverflow 上尝试了不同的解决方案,但没有人解决问题。
提前致谢
----------------------------------------
Error Detail:
----------------------------------------
imran@IJM:~/development/work/depot$ cap deploy:migrations
triggering load callbacks
* 2013-09-06 11:43:13 executing `deploy:migrations'
* 2013-09-06 11:43:13 executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote imran@IJM:git/depot.git master"
command finished in 359ms
.......
.......
* executing "[ -e /home/imran/IJM/shared/assets/manifest* ] && cat /home/imran/IJM/shared/assets/manifest* || echo"
servers: ["IJM"]
[IJM] executing command
command finished in 822ms
/home/imran/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): control characters are not allowed at line 1 column 1 (Psych::SyntaxError)
from /home/imran/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
from /home/imran/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:151:in `parse'
from /home/imran/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/psych.rb:127:in `load'
from /h
from /home/imran/.rvm/gems/ruby-1.9.3-p448/bin/cap:19:in `load'
from /home/imran/.rvm/gems/ruby-1.9.3-p448/bin/cap:19:in `<main>'
from /home/imran/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `eval'
from /home/imran/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `<main>'
-------------------------------------------------------------------------------------------
deploy.rb
-------------------------------------------------------------------------------------------
#---
# Excerpted from "Agile Web Development with Rails",
# published by The Pragmatic Bookshelf.
# Copyrights apply to this code. It may not be used to create training material,
# courses, books, articles, and the like. Contact us if you are in doubt.
# We make no guarantees that this code is fit for any purpose.
# Visit http://www.pragmaticprogrammer.com/titles/rails4 for more book information.
#---
require 'bundler/capistrano'
# be sure to change these
set :user, 'imran'
set :domain, 'IJM'
set :application, 'depot'
# adjust if you are using RVM, remove if you are not
require "rvm/capistrano"
set :rvm_ruby_string, '1.9.3'
set :rvm_type, :user
# file paths
set :repository, "#{user}@#{domain}:git/#{application}.git"
set :deploy_to, "/home/#{user}/#{domain}"
# distribute your applications across servers (the instructions below put them
# all on the same server, defined above as 'domain', adjust as necessary)
role :app, domain
role :web, domain
role :db, domain, :primary => true
# you might need to set this if you aren't seeing password prompts
#default_run_options[:pty] = true
default_run_options[:pty] = true
#default_run_options[:shell] = '/bin/bash'
# As Capistrano executes in a non-interactive mode and therefore doesn't cause
# any of your shell profile scripts to be run, the following might be needed
# if (for example) you have locally installed gems or applications. Note:
# this needs to contain the full values for the variables set, not simply
# the deltas.
# default_environment['PATH']='<your paths>:/usr/local/bin:/usr/bin:/bin'
# default_environment['GEM_PATH']='<your paths>:/usr/lib/ruby/gems/1.8'
# miscellaneous options
set :deploy_via, :remote_cache
set :scm, 'git'
set :branch, 'master'
set :scm_verbose, true
set :use_sudo, false
set :rails_env, :production
#IJM
#set :whenever_command, "bundle exec whenever"
namespace :deploy do
desc "cause Passenger to initiate a restart"
task :restart do
run "touch #{current_path}/tmp/restart.txt"
end
desc "reload the database with seed data"
task :seed do
run "cd #{current_path}; rake db:seed RAILS_ENV=#{rails_env}"
end
end
-------------------------------------------------------------------------------------------
.bashrc
-------------------------------------------------------------------------------------------
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
#PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
#[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
-------------------------------------------------------------------------------------------
.bash_profile
-------------------------------------------------------------------------------------------
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && \
. "$HOME/.rvm/scripts/rvm"
#source ~/.bashrc
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
最佳答案
我上周遇到了同样的问题,我用这个解决了
“这是你的钩子(Hook)/home/rails/.rvm/hooks/after_use_textmate - 禁用它 (chmod -x) 并且 rvm 将不再为它生成包装器。”
基于本期https://github.com/wayneeseguin/rvm/issues/1964#issuecomment-19410325
关于ruby-on-rails - cap deploy:migrations: 错误:第 1 行第 1 列不允许使用控制字符(Psych::SyntaxError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18652299/
使用这个通用元组类 public class Pair { private final T1 first; private final T2 second; public Pair(T1
我想不出执行此操作的递归算法。我的尝试是: void capValue(Node node) { if (node == null) return if (node.e
较新版本的 docker(我认为是 1.2 及更高版本)具有 --cap-add 功能。 这提供了对特性功能的细粒度控制,而无需使用 --privileged=true 打开所有内容。 我用谷歌搜索过
我开始使用 vim,我想重新映射一些键。有谁知道在 Lubuntu 中最简单的方法是什么。 谢谢 最佳答案 Caps Lock 键不能在 Vim 中映射,因为它不会自己生成键码。您可以在操作系统级别重
这是我的代码。 import java.util.stream.Stream; import java.util.List; import java.util.ArrayList; import ja
我想在 PyCharm 中使用 CapsLock-u 和 CapsLock-n 在代码和运行/终端之间切换。 在我的键盘上 u位于顶部,n在底部,这给了我一个很好的内存方法。 我不知道如何像这样配置我
我有一个值都是大写的对象,我想要 f.label帮助将其打印为全部大写 - 无需进行 CSS 转换。 现在,如果我有字符串 AAPL在我的对象中,f.label吐出来为 Aapl . 我不想使用 CS
我是电容器的新手,正在开发一个应用程序,我正在对代码进行更改并运行 ionic 构建 npx上限副本 npx盖帽开安卓 并且还推荐使用 npx cap sync代npx cap copy . 两者之间
print("Hello and welcome to your address book this program uses surnames or D.O.B to find people in
我在编写一些代码时遇到了一些让我烦恼的事情。我在下面的代码示例中收集了这两个示例。 cls1 行使用 lambda 表达式但不编译,而 cls2 行使用方法引用并编译。我知道如果我使用非泛型对象,我不
我一直在阅读有关名为Starcounter的数据库的信息。它声称可以处理“ NoSql”数据库只能处理的负载而不会降低一致性。据我了解CAP定理,如果保持一致性,则会失去可用性或分区容限。那么什么使S
分布式系统如何保持一致和可用-CA。因为当分区发生时,CA是不可能的。如果我们说不会发生分区,那么只有它们是CA,那么如果分区不会发生,那么所有CP或AP系统也将是CA。 最佳答案 不可以 如常提到的
我是 java 编程的初学者,并且在弄清楚如何限制代码中的金额时遇到问题。 我的代码有一个问题,该代码由 if-else if 语句组成,这更多的是如何限制奖金最高金额的问题。我希望我的奖金最高金额为
说到nosql分布式数据库系统,我们都知道它们都属于CAP定理的三取二。对于网络故障和节点故障不可避免的分布式集群,分区容忍是必要的,因此我们只能从可用性和一致性中选择一个。所以它基本上是 CP 或
python如何为视频制作一个简单的帽子。 Ideia:为 9 个均匀放置(在时间轴上)时间拍摄 9 个快照,然后在 JGP 中置换 我应该怎么做? PIL 是唯一的方法吗? (做我想做的事情并不容易
这个问题在这里已经有了答案: Is working past the end of a slice idiomatic? (2 个答案) 关闭 6 年前。 下面的go代码: var numbers4
我有一个 Silverlight 应用程序,它有两个不同的 XAP——一个由 HTML 页面静态加载的 InitialXAP 和一个从初始 XAP 中的代码加载的 DynamicXAP。 Dynami
In the wikipedia article on CAP Theorem( https://en.wikipedia.org/wiki/CAP_theorem ), it states (bol
在CAP定理中,Redis被指定为缺乏可用性(具有分区容错性和一致性)的数据库。 但是在很多地方,Redis 被认为是一种高可用的键值存储。 什么是对的?如果您能提供深入的答案,我将不胜感激。 最佳答
我被告知我必须放弃大型分布式系统中的事务保证,因为 CAP theorem说我不能拥有它。 我认为这是错误的,原因如下: 互联网路由非常可靠。 CAP 定理仅适用于两组事件机器无法通信的网络分区。 几
我是一名优秀的程序员,十分优秀!