简体   繁体   English

Ruby on Rails应用程序-没有要加载的文件

[英]Ruby on Rails application - No such file to load

I'm trying to bring up an old Ruby on Rails application from a crashed server, and when I try to access it via the browser, I get this screen: 我试图从崩溃的服务器中启动一个旧的Ruby on Rails应用程序,当我尝试通过浏览器访问它时,出现以下屏幕: 在此处输入图片说明

For copy-and-paste / searchability, here's the text: 对于复制和粘贴/可搜索性,以下为文本:

Ruby on Rails application could not be loaded
---------------------------------------------
A source file that the application requires, is missing.

    It is possible that you didn't upload your application files correctly. Please check whether all your application files are uploaded.
    A required library may not installed. Please install all libraries that this application requires.

Further information about the error may have been written to the application's log file. Please check it in order to analyse the problem.

Error message:
    no such file to load -- active_record/locking/optimistic
Exception class:
    LoadError
Application root:
    /srv/---REDACTED---/current 
Backtrace:
---the backtrace---

That first line mentioned in the backtrace is: 回溯中提到的第一行是:

include Locking::Optimistic, Locking::Pessimistic

So it's looking for active_record/locking/optimistic, which I found in a variety of other locations: 因此,它正在寻找active_record / locking / optimistic,我在其他许多地方都找到了它:

/data/srv/---REDACTED---/shared/bundle/ruby/1.8/gems/activerecord-3.0.20/lib/active_record/locking/optimistic.rb
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.20/lib/active_record/locking/optimistic.rb
/var/lib/gems/1.8/gems/activerecord-3.0.20/lib/active_record/locking/optimistic.rb

My problem is that I have no idea how to tell Ruby where to go look for the files it thinks are missing. 我的问题是我不知道如何告诉Ruby去哪里寻找它认为丢失的文件。 I am not a Ruby person and I don't know how Phusion Passenger runs things, but I know most languages have concepts of "paths" to search and I'm assuming I just need to set a path somewhere. 我不是Ruby的人,也不知道Phusion Passenger是如何运行的,但是我知道大多数语言都有搜索“路径”的概念,我假设我只需要在某个地方设置路径即可。

Any ideas? 有任何想法吗?

I ended up manually copying over the missing files from the /data/srv/---REDACTED---/shared/bundle/ruby/1.8/gems/activerecord-3.0.20/lib/active_record/locking/optimistic.rb 我最终从/data/srv/---REDACTED---/shared/bundle/ruby/1.8/gems/activerecord-3.0.20/lib/active_record/locking/optimistic.rb中手动复制了丢失的文件

...to the gem that was reporting the missing file, since it seemed to be the same gem and same version. ...到报告丢失文件的宝石,因为它似乎是相同的宝石和相同的版本。

Running the bundle install didn't change anything, for some reason. 由于某些原因,运行捆绑软件安装并没有做任何更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM