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:
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:
/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. 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.
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
...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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.