我有一台装有 Ruby 1.9.3 和 rails 3.2.3 的 Centos6 服务器。我使用 RVM。然后我安装了 ruby 2.0.0 和 rails 4.0.0。我用 RVM 更改了默认的 ruby 版本。并与ruby --version
我确认,然后适当地更改了我的Gemfile并运行bundle install
和/或bundle update
根据需要运行。一切都很好。然后我运行了service httpd restart
它,然后导航到我的网站并得到以下信息:
无法启动 Web 应用程序(Phusion 乘客错误)
Could not find minitest-4.7.5 in any of the sources (Bundler::GemNotFound)
/usr/local/rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:92:in `block in materialize'
/usr/local/rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'
/usr/local/rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'
/usr/local/rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
/usr/local/rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/definition.rb:159:in `specs_for'
/usr/local/rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/definition.rb:148:in `requested_specs'
/usr/local/rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/environment.rb:18:in `requested_specs'
/usr/local/rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:13:in `setup'
/usr/local/rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
/usr/local/rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.5/lib/phusion_passenger/loader_shared_helpers.rb:212:in `run_load_path_setup_code'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.5/helper-scripts/rack-preloader.rb:73:in `preload_app'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.5/helper-scripts/rack-preloader.rb:127:in `<module:App>'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.5/helper-scripts/rack-preloader.rb:6:in `<module:PhusionPassenger>'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/passenger-4.0.5/helper-scripts/rack-preloader.rb:5:in `<main>'
Environment variables
rvm_bin_path = /usr/local/rvm/bin
GEM_HOME = /usr/local/rvm/gems/ruby-1.9.3-p429
TERM = xterm
SHELL = /sbin/nologin
HISTSIZE = 1000
IRBRC = /usr/local/rvm/rubies/ruby-1.9.3-p429/.irbrc
PYTHONUNBUFFERED = 1
PASSENGER_ENV = production
PASSENGER_DEBUG_DIR = /tmp/passenger.spawn-debug.11360-47389796731312
SERVER_PORT = 80
MY_RUBY_HOME = /usr/local/rvm/rubies/ruby-1.9.3-p429
USER = nobody
REQUEST_URI = /
rvm_path = /usr/local/rvm
IN_PASSENGER = 1
RACK_ENV = production
REMOTE_PORT = 13101
rvm_prefix = /usr/local
PATH = /usr/local/rvm/gems/ruby-1.9.3-p429/bin:/usr/local/rvm/gems/ruby-1.9.3-p429@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p429/bin:/usr/local/rvm/bin:/usr/local/rvm/gems/ruby-2.0.0-p195/bin:/usr/local/rvm/gems/ruby-2.0.0-p195@global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p195/bin:/usr/local/rvm/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin
MAIL = /var/spool/mail/nobody
WSGI_ENV = production
LANG = C
HISTCONTROL = ignoredups
rvm_env_string = ruby-1.9.3-p429
rvm_version = 1.20.13 (stable)
SHLVL = 2
HOME = /
RAILS_ENV = production
rvm_ruby_string = ruby-1.9.3-p429
SERVER_SOFTWARE = Apache/2.2.15 (CentOS)
LOGNAME = nobody
QUERY_STRING =
CVS_RSH = ssh
GEM_PATH = /usr/local/rvm/gems/ruby-1.9.3-p429:/usr/local/rvm/gems/ruby-1.9.3-p429@global
LESSOPEN = |/usr/bin/lesspipe.sh %s
SERVER_PROTOCOL = HTTP/1.1
REQUEST_METHOD = GET
RUBY_VERSION = ruby-1.9.3-p429
G_BROKEN_FILENAMES = 1
_ORIGINAL_GEM_PATH = /usr/local/rvm/gems/ruby-1.9.3-p429:/usr/local/rvm/gems/ruby-1.9.3-p429@global
但是env
在命令行运行会显示这些:
GEM_HOME=/usr/local/rvm/gems/ruby-2.0.0-p195
MY_RUBY_HOME=/usr/local/rvm/rubies/ruby-2.0.0-p195
PATH=/usr/local/rvm/gems/ruby-2.0.0-p195/bin:/usr/local/rvm/gems/ruby-2.0.0-p195@global/bin:...and so on
GEM_PATH=/usr/local/rvm/gems/ruby-2.0.0-p195:usr/local/rvm/gems/ruby-2.0.0-p195@global
RUBY_VERSION=ruby-2.0.0-p195
我错过了什么?为什么 rails 会尝试使用错误版本的 ruby?