由于JSON不兼容,我将ruby从2.4.0降级到2.3.3。 但服务器并没有工作。我检查了我的日志,发现它仍在尝试执行最新版本(2.4.0)的ruby文件。
我在降级时删除了ruby上一版本的文件。 我该如何解决这个问题?
/.rvm / gems ls
缓存
红宝石2.3.3
ruby-2.3.3@global
红宝石2.4.0
ruby-2.4.0@global
/。rvm / gems / ruby-2.4.0 ls
宝石
/。rvm / gems / ruby-2.3.3 ls
仓
缓存
环境
宝石
包装 build_info DOC
扩展 规格
error.log中
App 20642 stdout: App 20642 stderr: *** ERROR ***: Cannot execute /home/ec2-user/.rvm/gems/ruby-2.4.0/wrappers/ruby: No such file or
目录(2) [2017-02-20 23:32:45.2704 5334 / 7fa2e3dde700 age / Cor / App / Implementation.cpp:230]:无法呈现错误页面: 不能打开 ' /home/ec2-user/.rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/resources/templates/error_layout.css' 用于阅读:没有这样的文件或目录(errno = 2) in' void Passenger :: ApplicationPool2 :: processAndLogNewSpawnException(Passenger :: SpawnException&, const Passenger :: ApplicationPool2 :: Options&,const ConfigPtr&)' (Implementation.cpp:206) in' void Passenger :: SpawningKit :: SmartSpawner :: throwPreloaderSpawnException(const string&,Passenger :: SpawnException :: ErrorKind, Passenger :: SpawningKit :: BackgroundIOCapturerPtr&,const Options&, const DebugDirPtr&)' (SmartSpawner.h:144) in' std :: string Passenger :: SpawningKit :: SmartSpawner :: negotiatePreloaderStartup(Passenger :: SpawningKit :: SmartSpawner :: StartupDetails&)' (SmartSpawner.h:617) in' void Passenger :: SpawningKit :: SmartSpawner :: startPreloader()' (SmartSpawner.h:273) in' virtual Passenger :: SpawningKit :: Result Passenger :: SpawningKit :: SmartSpawner :: spawn(const Options&)' (SmartSpawner.h:790) in' void Passenger :: ApplicationPool2 :: Group :: spawnThreadRealMain(const SpawnerPtr&,const Passenger :: ApplicationPool2 :: Options&,unsigned INT)' (SpawningAndRestarting.cpp:95)
[ 2017-02-20 23:32:45.2704 5334/7fa2e3dde700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for
application /home/ec2-user/Karolline.github.io:发生错误 启动预加载器时。它在发出信号之前退出 成功启动回Phusion Passenger。 错误ID:34b5bb42 来自应用程序的消息:启动预加载器时发生错误。它在成功启动信号之前退出 Phusion Passenger。请阅读这个 有关此问题的更多信息,请参阅文章
原始流程输出:
* ERROR *: Cannot execute /home/ec2-user/.rvm/gems/ruby-2.4.0/wrappers/ruby: No such file or directory (2)
[ 2017-02-20 23:32:45.2734 5334/7fa30287a700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 1-47] Cannot checkout
会话,因为发生了产生错误。错误的标识符 是34b5bb42。有关错误的详细信息,请参阅前面的日志。 [2017-02-20 23:32:45.2734 5334 / 7fa30287a700 age / Cor / Con / CheckoutSession.cpp:369]:[客户端1-47]无法渲染 错误页面:无法打开 ' /home/ec2-user/.rvm/gems/ruby-2.4.0/gems/passenger-5.1.2/resources/templates/error_layout.css' 用于阅读:没有这样的文件或目录(errno = 2) in' void Passenger :: Core :: Controller :: endRequestWithErrorResponse(Passenger :: Core :: Client **, Passenger :: ServerKit :: HttpServer :: Request **,const Passenger :: StaticString&amp ;,, const Passenger :: SpawnException *)' (CheckoutSession.cpp:350) in' void Passenger :: Core :: Controller :: writeSpawnExceptionErrorResponse(Passenger :: Core :: Client *, Passenger :: ServerKit :: HttpServer :: Request *,const 提高:: shared_ptr的和放;)' (CheckoutSession.cpp:282) in' void Passenger :: Core :: Controller :: reportSessionCheckoutError(Passenger :: Core :: Client *, Passenger :: ServerKit :: HttpServer :: Request *,const ExceptionPtr&)' (CheckoutSession.cpp:235) in' void Passenger :: Core :: Controller :: sessionCheckedOutFromEventLoopThread(Passenger :: Core :: Client *, Passenger :: ServerKit :: HttpServer :: Request *,const AbstractSessionPtr&,const ExceptionPtr和放大器;)' (CheckoutSession.cpp:148) in' void Passenger :: Core :: Controller :: sessionCheckedOutFromAnotherThread(Passenger :: Core :: Client *, 客运:: ServerKit :: HttpServer的::请求* 客运:: ApplicationPool2 :: AbstractSessionPtr, 客运:: ApplicationPool2 :: ExceptionPtr)' (CheckoutSession.cpp:114) - 客户1-47
gem env
RubyGems环境: - RUBYGEMS版本:2.6.10
- RUBY VERSION:2.3.3(2016-11-21 patchlevel 222)[x86_64-linux]
- 安装目录:/home/ec2-user/.rvm/gems/ruby-2.3.3
- 用户安装目录:/home/ec2-user/.gem/ruby/2.3.0
- RUBY EXECUTABLE:/home/ec2-user/.rvm/rubies/ruby-2.3.3/bin/ruby
- 可执行目录:/home/ec2-user/.rvm/gems/ruby-2.3.3/bin
- SPEC CACHE目录:/home/ec2-user/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY:/home/ec2-user/.rvm/rubies/ruby-2.3.3/etc
- RUBYGEMS PLATFORMS:
- 红宝石
- x86_64的Linux的
- GEM路径:
- /home/ec2-user/.rvm/gems/ruby-2.3.3
- /home/ec2-user/.rvm/gems/ruby-2.3.3@global
- GEM配置:
- :update_sources =>真
- :verbose =>真
- :backtrace =>假
- :bulk_threshold => 1000
- 远程来源:
- SHELL PATH:
- /home/ec2-user/.rvm/gems/ruby-2.3.3/bin
- /home/ec2-user/.rvm/gems/ruby-2.3.3@global/bin
- /home/ec2-user/.rvm/rubies/ruby-2.3.3/bin
- 的/ usr / local / bin中
- / bin中
- 的/ usr / bin中
- 的/ usr / local / sbin中
- / usr / sbin目录
- / sbin目录
- 的/ opt / AWS / bin中
- /home/ec2-user/.rvm/bin
- /home/ec2-user/.local/bin
- /家庭/ EC2用户/ bin中
答案 0 :(得分:0)
我使用以下代码重新安装了ruby 2.4.0
rvm install 2.4.0
rvm use 2.4.0
然后我选择了红宝石2.3.3
rvm use 2.3.3