我的 rails 应用程序在许多方面都运行良好,但是当我尝试在生产服务器上生成 pdf 时,出现以下错误。在我的本地计算机上,它工作正常。我该怎么办?。
Command Error: /home/deploy/.rbenv/versions/2.7.2/lib/ruby/2.7.0/bundler/definition.rb:495:in `validate_ruby!': Your Ruby version is 2.7.0, but your Gemfile specified 2.7.2 (Bundler::RubyVersionMismatch)
from /home/deploy/.rbenv/versions/2.7.2/lib/ruby/2.7.0/bundler/definition.rb:470:in `validate_runtime!'
from /home/deploy/.rbenv/versions/2.7.2/lib/ruby/2.7.0/bundler.rb:143:in `setup'
from /home/deploy/.rbenv/versions/2.7.2/lib/ruby/2.7.0/bundler/setup.rb:20:in `block in <top (required)>'
from /home/deploy/.rbenv/versions/2.7.2/lib/ruby/2.7.0/bundler/ui/shell.rb:136:in `with_level'
from /home/deploy/.rbenv/versions/2.7.2/lib/ruby/2.7.0/bundler/ui/shell.rb:88:in `silence'
from /home/deploy/.rbenv/versions/2.7.2/lib/ruby/2.7.0/bundler/setup.rb:20:in `<top (required)>'
from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'```
Note that am using ruby 2.7.2 and I dont have ruby 2.7.0
答案 0 :(得分:0)
尝试删除应用根目录中的“bundle”文件夹(在生产服务器上),然后运行“bundle”或“bundle install”。前段时间为我解决了这个问题。