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

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

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

如果我进入版本目录并运行bundle install,则使用rake-10.0.3。 两个应用程序之间的唯一区别是我尝试安装的新应用程序使用资产管道。

这是我的部署文件,除了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' 
 bundle update rake 

为我工作。 我有类似的问题。

如果您还在寻找修复…对我而言,这是使用sudo bundle install而不仅仅是bundle install

我有这个相同的神秘错误消息….事实certificate我在release文件夹中创建了一个’克隆’版本,导致sprockets想要在那里做事….我认为cap使用创建日期,因为它遍历发布树,所以不知何故这搞砸了….确保你的/ releases /文件夹中没有额外的’手工制作’文件夹,你应该通过这个bug

我有同样的问题。 我的问题的原因是除了在rbenv中的shims目录之外,还在/usr/bin/local/中找到了Rake。 要检查这是否是问题首先卸载rake gem uninstall rake然后运行which rake 。 如果您返回的路径与/Users/username/.rbenv/shims/rake不同,则只需使用sudo rm /path/to/file删除该二进制sudo rm /path/to/file

请注意,至少在我的情况下, which gem使用由rbenv管理的shimed可执行文件,而rake不是。 所以一切正常,直到我试图从终端调用rake command

另请参阅: 安装rbenv并更改Ruby版本后,Rake不再运行

对于4.3版的rails版本,让我们尝试使用bundle exec rails app:update 。 它对我有用。

希望它对你有用。