在任何来源中都找不到rake-10.0.3 [英] Could not find rake-10.0.3 in any of the sources
问题描述
在Railscasts 335部署到vps之后,我在Rackspace的Ubuntu 12.04服务器上成功安装了Rails(3.2.10)应用程序。 Nginx,Unicorn,rbenv和Capistrano。
I successfully installed a Rails (3.2.10) app on an Ubuntu 12.04 server on Rackspace following Railscasts 335 deploying to a vps. Nginx, Unicorn, rbenv and Capistrano.
然后,当我尝试安装第二个Rails网站时,出现错误消息在以下任何位置都找不到rake-10.0.3 cap:deploy中的来源。 cap:setup和cap:check成功。另外,我的应用程序文件夹下没有当前目录。
Then, when I try to install a second rails website I get the error "Could not find rake-10.0.3 in any of the sources" during cap:deploy. cap:setup and cap:check were successful. Additionally, there is no current directory under my application folder.
如果我进入releases目录并运行bundle安装,则使用rake-10.0.3。这两个应用程序之间的唯一区别是,我要安装的新应用程序使用资产管道。
If I cd into the releases directory and run bundle install it is using rake-10.0.3. The only difference between the two apps is that the new app I am trying to install uses the assets pipeline.
这里是我的部署文件,除了两个应用程序外,其他文件都相同
Here is my deploy file which is identical for both apps, except for the set :application directive.
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卸载rake
删除Gemfile.lock ==> rm Gemfile.lock
运行捆绑安装==> 捆绑安装
Remove all the versions of Rake ==> gem uninstall rake
Remove Gemfile.lock ==> rm Gemfile.lock
Run bundle install ==> bundle install
gem install rake --version=10.0.2
如果仍然出现错误,则将其放入您的gemfile中。
if you still get the error then put this into your gemfile.
gem 'rake', '0.8.7'
这篇关于在任何来源中都找不到rake-10.0.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!