加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-16 19:48:51 所属栏目:百科 来源:网络整理
导读:我在Railscasts 335部署到vps后,在Rackspace上的Ubuntu 12.04服务器上成功安装了Rails(3.2.10)应用程序. Nginx,Unicorn,rbenv和Capistrano. 然后,当我尝试安装第二个rails网站时,会在cap:deploy期间得到错误“无法找到任何来源的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”.上限:设置和上限:检查成功.此外,我的应用程序文件夹下没有当前目录.

如果我进入版本目录并运行捆绑安装它正在使用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 ==>宝石卸载耙子
删除Gemfile.lock ==> rm Gemfile.lock
运行bundle install ==>捆绑安装
gem install rake --version=10.0.2

如果您仍然收到错误,请将其放入您的gemfile中.

gem 'rake','0.8.7'

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读