Ruby on rails 如何解决Ruby版本为2.3.1,而Gemfile指定为2.5.1的问题?
你好,我正在使用Phusion Passenger和NGINX运行RoR应用程序。 但我犯了这个错误 Phusion乘客应用程序服务器试图启动web应用程序。但是应用程序本身(而不是乘客)遇到了一个内部错误 错误详细信息:Ruby on rails 如何解决Ruby版本为2.3.1,而Gemfile指定为2.5.1的问题?,ruby-on-rails,ruby,nginx,passenger,Ruby On Rails,Ruby,Nginx,Passenger,你好,我正在使用Phusion Passenger和NGINX运行RoR应用程序。 但我犯了这个错误 Phusion乘客应用程序服务器试图启动web应用程序。但是应用程序本身(而不是乘客)遇到了一个内部错误 错误详细信息: Your Ruby version is 2.3.1, but your Gemfile specified 2.5.1 (Bundler::RubyVersionMismatch) /var/lib/gems/2.3.0/gems/bundler-1.16.2/lib/
Your Ruby version is 2.3.1, but your Gemfile specified 2.5.1 (Bundler::RubyVersionMismatch)
/var/lib/gems/2.3.0/gems/bundler-1.16.2/lib/bundler/definition.rb:491:in `validate_ruby!'
/var/lib/gems/2.3.0/gems/bundler-1.16.2/lib/bundler/definition.rb:466:in `validate_runtime!'
/var/lib/gems/2.3.0/gems/bundler-1.16.2/lib/bundler.rb:101:in `setup'
/var/lib/gems/2.3.0/gems/bundler-1.16.2/lib/bundler/setup.rb:20:in `<top (required)>'
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:363:in `activate_gem'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:221:in `block in run_load_path_setup_code'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:527:in `running_bundler'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:220:in `run_load_path_setup_code'
/usr/share/passenger/helper-scripts/rack-preloader.rb:91:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:189:in `block in <module:App>'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:380:in `run_block_and_record_step_progress'
/usr/share/passenger/helper-scripts/rack-preloader.rb:188:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'
The stdout/stderr output of the subprocess so far is:
Error: The application encountered the following error: Your Ruby version is 2.3.1, but your Gemfile specified 2.5.1 (Bundler::RubyVersionMismatch)
/var/lib/gems/2.3.0/gems/bundler-1.16.2/lib/bundler/definition.rb:491:in `validate_ruby!'
/var/lib/gems/2.3.0/gems/bundler-1.16.2/lib/bundler/definition.rb:466:in `validate_runtime!'
/var/lib/gems/2.3.0/gems/bundler-1.16.2/lib/bundler.rb:101:in `setup'
/var/lib/gems/2.3.0/gems/bundler-1.16.2/lib/bundler/setup.rb:20:in `<top (required)>'
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:363:in `activate_gem'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:221:in `block in run_load_path_setup_code'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:527:in `running_bundler'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:220:in `run_load_path_setup_code'
/usr/share/passenger/helper-scripts/rack-preloader.rb:91:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:189:in `block in <module:App>'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:380:in `run_block_and_record_step_progress'
/usr/share/passenger/helper-scripts/rack-preloader.rb:188:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'
但是/var/lib/gems目录中没有任何gem文件夹2.5.1。
只有2.3.0文件夹存在
甚至ruby版本2.5.1也不在/usr/lib/ruby/目录中。目前只有2.3.0
编辑:我还试图更改Gemfile中的ruby版本,但出现了一个错误
Your Ruby version is 2.5.1, but your Gemfile specified 2.3.1
但是,当我用rails s启动我的应用程序时,应用程序将启动。尝试使用RVM()并安装正确的ruby版本并设置默认版本。将
Gemfile
中的版本更改回2.5.1,然后运行bundle install
。这将更新您的Gemfile.lock,并将在需要时重新安装或更新依赖项
之后,试着从乘客开始
我认为名为2.3.0
的文件夹是一个骗人的东西。我注意到文件夹名称似乎与ruby版本不同步,所以我会忽略这一点
Your Ruby version is 2.5.1, but your Gemfile specified 2.3.1