我尝试使用卡皮斯特拉诺在 Rails 应用程序上。
但我遇到了一些问题:当我跑步时cap production deploy:check
,看起来还可以
只有错误的信息:这有关系吗?
DEBUG [a8c55ce2] Command: /usr/bin/env which passenger
DEBUG [a8c55ce2] Finished in 0.004 seconds with exit status 1 (failed).)
但当我跑步时cap production deploy
,获取消息:
调试 [a71a7cfc] bash: /usr/local/rbenv/bin/rbenv: 没有这样的文件或
目录
我搜索我的服务器,没有 /usr/local/rbenv/bin/rbenv。但我有/usr/local/rbenv
我可以使用 Rails 并为 Rails 应用程序部署网站,我怎样才能找到正确的路径/usr/local/rbenv/bin/rbenv
?或者这是另一个问题?
这是我的设置:
lock '3.4.0'
`ssh-add` # need this to make key-forwarding work
set :application, 'myapp'
set :repo_url, 'my ssh'
set :deploy_to, '/home/john/projects/myapp'
set :log_level, :debug
set :keep_releases, 5
set :linked_files, %w(config/database.yml config/secrets.yml)
set :linked_dirs, fetch(:linked_dirs, []).push("bin", "log", "tmp/pids", "tmp/cache", "tmp/sockets", "vendor/bundle", "public/system")
set :rbenv_type, :user
set :rbenv_ruby, "2.2.2"
set :rbenv_path, "/usr/local/rbenv"
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
set :rbenv_map_bins, %w(rake gem bundle ruby rails)
set :rbenv_roles, :all
namespace :deploy do
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
execute :rake, 'cache:clear'
end
end
end
我的文件夹
john@ip:/usr/local/rbenv$ ls -l
total 12
drwxr-xr-x 2 john admin 4096 Aug 5 16:44 shims
-rw-r--r-- 1 john admin 6 Aug 4 15:40 version
drwxr-xr-x 3 john admin 4096 Aug 4 15:33 versions
我发现我的插件有 3 条可能的路径:
/home/john/.rbenv/plugins/ruby-build/bin
/home/john/.rbenv/versions/2.2.2/bin
/home/john/.rbenv/bin
我认为是我的安装rbenv问题导致了这个路径问题。