gpt4 book ai didi

ruby-on-rails - 您正在尝试在更改 Gemfile 后以部署模式安装

转载 作者:行者123 更新时间:2023-12-01 21:20:01 25 4
gpt4 key购买 nike

我正在尝试将我的 Rails 应用程序部署到我的 DigitalOcean 服务器

cap production deploy

但我收到错误,

(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@178.62.204.53: bundle exit status: 16
bundle stdout: You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

You have deleted from the Gemfile:
* rails-assets-angular-devise

You have changed in the Gemfile:
* rails-assets-angular-devise from `no specified source` to `rubygems repository
https://rubygems.org/, https://rails-assets.org/`
bundle stderr: Nothing written

SSHKit::Command::Failed: bundle exit status: 16
bundle stdout: You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

You have deleted from the Gemfile:
* rails-assets-angular-devise

You have changed in the Gemfile:
* rails-assets-angular-devise from `no specified source` to `rubygems repository
https://rubygems.org/, https://rails-assets.org/`
bundle stderr: Nothing written

Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as deploy@178.62.204.53: bundle exit status: 16
bundle stdout: You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

You have deleted from the Gemfile:
* rails-assets-angular-devise

You have changed in the Gemfile:
* rails-assets-angular-devise from `no specified source` to `rubygems repository
https://rubygems.org/, https://rails-assets.org/`
bundle stderr: Nothing written
alucardu@alucardu-VirtualBox:~/sites/movieseat(Deploy) $ source "https://rails-assets.org" do
bash: https://rails-assets.org: No such file or directory
alucardu@alucardu-VirtualBox:~/sites/movieseat(Deploy) $ gem "rails-assets-angular-devise"
ERROR: While executing gem ... (Gem::CommandLineError)
Unknown command rails-assets-angular-devise
alucardu@alucardu-VirtualBox:~/sites/movieseat(Deploy) $ end

我的 Gemfile 和 Gemfile.lock 有问题,它与 rails-assets-angular-devise 有关,但我不知道如何修复它。

我尝试在我的服务器上运行bundle install,但仍然出现相同的错误。我尝试删除 Gemlock.file 并在本地执行 bundle install,然后提交它并将其推送到我的部署分支,但仍然出现相同的错误。

这是gemfile中的rails-assets-angular-devise部分。

source "https://rails-assets.org" do
gem "rails-assets-angular-devise"
end

最佳答案

检查服务器上正确的 gemset 中的捆绑程序版本 - 可能您的 gemset 或本地 gem 中有旧的捆绑程序版本(如果您不在服务器上使用 rvm)

我有同样的问题,解决步骤:

  • 登录服务器
  • 根据您的应用正确切换 RVM
  • $ gem 更新捆绑程序
  • 关闭 ssh session 并重试cap [env]部署

关于ruby-on-rails - 您正在尝试在更改 Gemfile 后以部署模式安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32380828/

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