gpt4 book ai didi

ruby-on-rails - 在任何来源中都找不到 rake-10.0.3

转载 作者:行者123 更新时间:2023-12-03 15:16:16 24 4
gpt4 key购买 nike

在 Railscasts 335 部署到 vps 之后,我在 Rackspace 上的 Ubuntu 12.04 服务器上成功安装了 Rails (3.2.10) 应用程序。 Nginx、 unicorn 、rbenv 和 Capistrano。

然后,当我尝试安装第二个 rails 网站时,我在 cap:deploy 期间收到错误“无法在任何来源中找到 rake-10.0.3”。 cap:setup 和 cap:check 成功。此外,我的应用程序文件夹下没有当前目录。

如果我 cd 进入发布目录并运行 bundle install 它正在使用 rake-10.0.3。这两个应用程序之间的唯一区别是我尝试安装的新应用程序使用 Assets 管道。

这是我的部署文件,除了 set :application 指令外,这两个应用程序都是相同的。

set :user, 'mark'
set :scm_passphrase, 'xxxx'
set :domain, '99.99.99.99'
set :application, "my_app"

set :repository, "#{user}@#{domain}:git/#{application}.git"

ssh_options[:forward_agent] = true

set :deploy_to, "/var/www/#{application}"

role :app, domain
role :web, domain
role :db, domain, :primary => true

default_run_options[:pty] = true

set :deploy_via, :remote_cache

set :scm, 'git'
set :branch, 'master'
set :scm_verbose, true
set :use_sudo, false

after "deploy", "deploy:cleanup" # keep only the last 5 releases

namespace :deploy do
%w[start stop restart].each do |command|
desc "#{command} unicorn server"
task command, roles: :app, except: {no_release: true} do
run "/etc/init.d/unicorn_#{application} #{command}"
end
end

task :setup_config, roles: :app do
sudo "ln -nfs #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{application}"
sudo "ln -nfs #{current_path}/config/unicorn_init.sh /etc/init.d/unicorn_#{application}"
run "mkdir -p #{shared_path}/config"
put File.read("config/database.yml"), "#{shared_path}/config/database.yml"
puts "Now edit the config files in #{shared_path}."
end
after "deploy:setup", "deploy:setup_config"

task :symlink_config, roles: :app do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end
after "deploy:finalize_update", "deploy:symlink_config"

desc "Make sure local git is in sync with remote."
task :check_revision, roles: :web do
unless `git rev-parse HEAD` == `git rev-parse origin/master`
puts "WARNING: HEAD is not the same as origin/master"
puts "Run `git push` to sync changes."
exit
end
end
before "deploy", "deploy:check_revision"
end

最佳答案

删除所有版本的 Rake ==> gem uninstall rake删除 Gemfile.lock ==> rm Gemfile.lock运行 bundle install ==> bundle install

gem install rake --version=10.0.2

如果您仍然收到错误,则将其放入您的 gemfile 中。
gem 'rake', '0.8.7'

关于ruby-on-rails - 在任何来源中都找不到 rake-10.0.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14169828/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com