我有一个简单的Sinatra应用程序,我在本地运行`rackup -p 9210'命令,我想编写一个capistrano任务,在部署到我的服务器后,将启动我的Sinatra应用程序,我会在本地执行。
这里'是我的任务:
desc 'Start application'
task :start do
on roles(:app), in: :sequence, wait: 5 do
within '/my/app/folder/' do
execute "rackup -p 9210"
end
end
end
但错误消息显示:
Caused by:
SSHKit::Command::Failed: rackup -p 9210 exit status: 127
rackup -p 9210 stdout: Nothing written
rackup -p 9210 stderr: bash: rackup: command not found
我尝试过执行此命令:
desc 'Start application'
task :start do
on roles(:app), in: :sequence, wait: 5 do
execute "cd /my/app/folder/ && rackup -p 9210"
end
end
end
但得到了相同的错误消息。 我的文件夹:
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rvm'
set :rvm_type, :user
set :rvm_ruby_version, '2.3.0p0'
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
我在这里缺少什么?