【问题标题】:block in materialize Could not find multi_json-1.8.0 in any of the sources rails在物化中阻止在任何源轨道中找不到 multi_json-1.8.0
【发布时间】:2013-10-19 19:09:08
【问题描述】:

这是我的 deploy.rb

require "bundler/capistrano"

set :rvm_ruby_string, "ruby-2.0.0-p247"
set :rvm_type, :user

set :application, "myapp"
set :repository,  "git@bitbucket.org:user/myapp.git"
set :user, "my-server-username-ssh"
set :branch, "master"

set :deploy_to, "/var/rails_apps/myapp"  # I have current, release and shared directory here
set :deploy_via, :copy
set :use_sudo, true
set :rvm_install_with_sudo, true

default_run_options[:pty] = true

set :port, 1234

set :scm, :git

role :web, "myapp.com"
role :app, "myapp.com"
role :db,  "myapp.com", :primary => true
role :db,  "myapp.com"

after "deploy:update_code","deploy:config_symlink"

set :rvm_type, :system

# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
  task :start do ; end
  task :stop do ; end
  task :restart, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  end

  task :config_symlink do
    #run "cp #{release_path}/config/database.yml.example #{release_path}/config/database.yml"
  end

  desc 'Re-establish database.yml'
  task :set_database_symlink do
    run "rm -fr #{current_path}/config/database.yml && cd #{current_path}/config &&
        ln -nfs #{shared_path}/database.yml database.yml" 
  end
end

before 'deploy', 'rvm:install_ruby'
before 'deploy', 'rvm:create_gemset'

require "rvm/capistrano"

如果我运行 cap deploy:migrate

我收到错误没有找到数据库错误。

当我在我的服务器中手动运行 rake db:create 时,我遇到了这个错误

/usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find multi_json-1.8.0 in any of the sources (Bundler::GemNotFound)

如何创建和迁移我的数据库。

Edit-1

即使我已经使用

更新了我的证书

rvm osx-ssl-certs update all

在我的宝石列表中我可以的

multi_json (1.8.2)

【问题讨论】:

    标签: ruby-on-rails deployment ruby-on-rails-3.1 ruby-on-rails-4


    【解决方案1】:

    我已经安装了这个 gem,但我需要

    bundle update multi_json
    

    【讨论】:

      【解决方案2】:

      似乎您可能对 multi_json gem 的多个版本有要求。您可以尝试指定 gem 版本,如:

      gem 'multi_json', '1.8.0'
      

      在本地重新运行 bundle 命令并在部署之前检查您的 Gemfile.lock。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-05-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-07-20
        • 2023-03-12
        相关资源
        最近更新 更多