使用capistrano部署我的rails应用程序时,我有一个非常奇怪的错误.有时它是部署,有时不是.例如,我向css添加一些东西(只有一个字符串),例如.my_some_class{width:10px}
,在部署失败之后.在我添加之前 - 它部署好了.我确定没有其他任何改变因为我做了实验提交只包含一个css字符串.我的配置:
rails 4.1.0
ruby 2.1.1p76
gem 'capistrano-rails', group: :development
gem 'capistrano-rvm', group: :development
gem 'capistrano-bundler', group: :development
Run Code Online (Sandbox Code Playgroud)
部署日志结束:
Tasks: TOP => deploy:assets:precompile
(See full trace by running task with --trace)
The deploy has failed with an error: #<SSHKit::Command::Failed: rake exit status: 137
rake stdout: Nothing written
rake stderr: SafeYAML Warning
----------------
You appear to have an outdated version of libyaml (0.1.4) installed on your system.
Prior to 0.1.6, libyaml is vulnerable to a heap overflow exploit …Run Code Online (Sandbox Code Playgroud) 哪种方式,我可以通过远程服务器上的capistrano运行rake命令.
例如,我有lib/task/reparse.rake一些方法
desc "it's take csv file, makes some changes and fill db with this info"
task :example1 => :environment do
require 'csv'
rows_to_insert = []
# some actions
# ...
end
Run Code Online (Sandbox Code Playgroud)
在本地服务器上一切都很好 - 我只是运行rake reparse:example1
它的工作(正确填充数据库).所以问题是 - 如何在部署后在真实主机上运行此命令?
我使用rails 4.1 + capistrano 3.
来自网站的PS示例不适用于我 如何从Capistrano运行rake任务?
如果我尝试cap production rake:invoke task=reparse:land
失败的话:
cap aborted!
Don't know how to build task 'rake:invoke'
Run Code Online (Sandbox Code Playgroud)
一些修复
namespace :somenamespace do
task :runrake do
on roles(:all), in: :sequence, wait: 5 do
within release_path …Run Code Online (Sandbox Code Playgroud) 我正在使用rails 4.1.0并尝试从这里挂载ckeditor https://github.com/galetahub/ckeditor
我有问题,然后尝试加载任何页面,管理页面除外(它的工作正常):
ERROR Asset filtered out and will not be served:
Run Code Online (Sandbox Code Playgroud)
并且它要求将一些ckeditor的文件添加到aplication.rb
例如,文件:
config.assets.precompile += %w( ckeditor/filebrowser/javascripts/fileuploader.js )
config.assets.precompile += %w( ckeditor/filebrowser/javascripts/jquery.endless-scroll.js )
config.assets.precompile += %w( ckeditor/filebrowser/javascripts/jquery.min.js )
config.assets.precompile += %w( ckeditor/filebrowser/javascripts/jquery.tmpl.min.js
Run Code Online (Sandbox Code Playgroud)
如果我将此添加到application.rb,并重新加载服务器,rails询问下一个文件...
我按说明安装所有:
我的宝石文件:
gem 'paperclip', github: 'thoughtbot/paperclip'
gem 'ckeditor'
Run Code Online (Sandbox Code Playgroud)
控制台命令:
bundle install
rails generate ckeditor:install --orm=active_record --backend=paperclip
Run Code Online (Sandbox Code Playgroud)
的application.js
//= require ckeditor/override
//= require ckeditor/init
Run Code Online (Sandbox Code Playgroud)
别人有这样的问题吗?
更新:我并不孤单这样的错误.在ckeditor问题列表中添加了同样的问题 https://github.com/galetahub/ckeditor/issues/436