我undefined local variable or method 'rails_env'
在做的时候
执行“ cd#{current_path} && RAILS_ENV =#{rails_env}捆绑包执行rake sunspot:solr:stop”
我不是大型Capistrano或Rails专家。
在deploy.rb我有
namespace :solr do
desc "start solr"
task :start do
on roles(:app) do
execute "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec rake sunspot:solr:start"
end
end
desc "stop solr"
task :stop do
on roles(:app) do
execute "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec rake sunspot:solr:stop"
end
end
desc "reindex the whole database"
task :reindex do
on roles(:app) do
invoke 'solr:stop'
execute "rm -rf #{shared_path}/solr/data/*"
invoke 'solr:start'
execute "cd #{current_path} && RAILS_ENV=#{rails_env} d"
end
end
desc "Symlink in-progress deployment to a shared Solr index"
task :symlink do
on roles(:app) do
execute "ln -s #{shared_path}/solr/data/ #{release_path}/solr/data"
execute "ln -s #{shared_path}/solr/pids/ #{release_path}/solr/pids"
invoke 'solr:reindex'
end
end
end
after "deploy:finishing", "solr:symlink"
在deploy / staging.rb上,我有
set :rails_env, :staging
错过了什么?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句