运行导轨"require cannot load such file, rescue in <top (required)> & block in require"时出错



我正在使用Ruby 2.5.5p157,Rails 4.2.6,git bash 2.22.0,Bundler版本1.13.6和Windows 10 OS。 我目前正在接管另一个人完成的一个项目以添加一些次要功能,但发现该项目是用我没有背景的 ruby 完成的。我有整个完整的项目文件,我需要设置一个单独的数据库服务器来添加一个新功能来测试它,但该项目是几年前完成的,我无法联系到那个人,因为我不知道谁是做它的人。 所以在这里,我试图在安装 git bash、ruby 和 rails 后设置文件的数据库,但在我有"捆绑安装"并在 git bash 中运行"rails s"后遇到此错误。

我尝试卸载PG gem并再次安装,更新捆绑包和安装捆绑包,但这些不起作用。我也尝试过更新PG,但也没有工作。

$ rails s
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/pg-0.18.4-x64-mingw32/lib/pg.rb:14:in `require': cannot load such file -- 2.5/pg_ext (LoadError)
from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/pg-0.18.4-x64-mingw32/lib/pg.rb:14:in `rescue in <top (required)>'
from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/pg-0.18.4-x64-mingw32/lib/pg.rb:3:in `<top (required)>'
from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:81:in `require'
from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:81:in `block (2 levels) in require'
from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `each'
from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `block in require'
from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `each'
from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `require'
from C:/Ruby25-x64/lib/ruby/site_ruby/2.5.0/bundler.rb:114:in `require'
from C:/sites/nyp-backend/config/application.rb:7:in `<top (required)>'
from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:78:in `require'
from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `tap'
from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `server'
from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

这是我的 jem 列表,以防您需要知道:

$ gem list
aasm (4.10.1, 4.10.0)
actioncable (5.2.3)
actionmailer (5.2.3, 4.2.6)
actionpack (5.2.3, 4.2.6)
actionview (5.2.3, 4.2.6)
activejob (5.2.3, 4.2.6)
activemodel (5.2.3, 4.2.6)
activerecord (5.2.3, 4.2.6)
activestorage (5.2.3)
activesupport (5.2.3, 4.2.6)
acts_as_commentable (4.0.2)
acts_as_list (0.7.4)
administrate (0.2.2)
akami (1.3.1)
arel (9.0.0, 6.0.4, 6.0.3)
autoprefixer-rails (6.7.7.2)
aws-sdk (1.67.0)
aws-sdk-v1 (1.67.0)
axiom-types (0.1.1)
bcrypt (3.1.13, 3.1.11 x64-mingw32)
better_errors (2.5.1)
bigdecimal (default: 1.3.4)
binding_of_caller (0.8.0)
bootstrap-datepicker-rails (1.6.0.1)
bootstrap-sass (3.3.7)
bootstrap3-datetimepicker-rails (4.17.47)
builder (3.2.3, 3.2.2)
bundle (0.0.1)
bundler (2.0.1, default: 1.17.3, 1.13.6)
byebug (11.0.1, 8.2.2)
cancancan (1.17.0, 1.13.1)
capistrano (3.4.1)
capistrano-bundler (1.5.0)
capistrano-faster-assets (1.1.0)
capistrano-passenger (0.2.0)
capistrano-rails (1.1.8)
capistrano-rvm (0.1.2)
chronic (0.10.2)
chunky_png (1.3.11, 1.3.5)
climate_control (0.2.0)
cmath (default: 1.0.0)
cocaine (0.5.8)
cocoon (1.2.9)
coderay (1.1.2, 1.1.1)
coercible (1.0.0)
coffee-rails (4.1.1)
coffee-script (2.4.1)
coffee-script-source (1.12.2, 1.10.0)
compass (1.0.3)
compass-core (1.0.3)
compass-import-once (1.0.5)
compass-rails (3.0.2)
concurrent-ruby (1.1.5, 1.0.1)
crass (1.0.4)
csv (default: 1.0.0)
daemons (1.2.6, 1.2.3)
database_cleaner (1.5.3, 1.5.1)
date (default: 1.0.0)
datetime_picker_rails (0.0.7)
dbm (default: 1.0.0)
debug_inspector (0.0.3, 0.0.2)
delayed_job (4.1.5)
delayed_job_active_record (4.1.3)
descendants_tracker (0.0.4)
devise (3.5.10)
did_you_mean (1.2.0)
diff-lcs (1.3, 1.2.5)
dotenv (2.1.2, 2.1.1)
dotenv-rails (2.1.2)
equalizer (0.0.11)
erubi (1.8.0)
erubis (2.7.0)
etc (default: 1.0.0)
exception_notification (4.1.1)
execjs (2.7.0, 2.6.0)
factory_girl (4.5.0)
factory_girl_rails (4.5.0)
faker (1.6.6, 1.6.3)
fcntl (default: 1.0.0)
ffi (1.11.1 x64-mingw32, 1.9.10 x64-mingw32)
fiddle (default: 1.0.0)
fileutils (default: 1.0.2)
formatador (0.2.5)
gdbm (default: 2.0.0)
globalid (0.4.2)
grape (0.15.0)
grape-entity (0.4.8)
grape-swagger (0.10.5)
grape-swagger-rails (0.2.2)
guard (2.15.0)
guard-compat (1.2.1)
guard-rspec (4.6.5)
gyoku (1.3.1)
hashie (3.6.0, 3.4.3)
hashie-forbidden_attributes (0.1.1)
httpi (2.4.4)
i18n (1.6.0, 0.9.5, 0.7.0)
ice_nine (0.11.2)
io-console (default: 0.4.6)
ipaddr (default: 1.2.0)
jbuilder (2.9.1)
jquery-rails (4.3.3)
json (default: 2.1.0, 1.8.6)
kaminari (0.16.3)
listen (3.1.5)
loofah (2.2.3)
lumberjack (1.0.13, 1.0.10)
mail (2.7.1)
marcel (0.3.3)
method_source (0.9.2, 0.8.2)
mime-types (3.2.2)
mime-types-data (3.2019.0331, 3.2016.0221)
mimemagic (0.3.3, 0.3.0)
mini_mime (1.0.1)
mini_portile2 (2.4.0, 2.0.0)
minitest (5.11.3, 5.10.3, 5.8.4)
momentjs-rails (2.20.1)
multi_json (1.13.1, 1.11.2)
multi_xml (0.6.0, 0.5.5)
neat (1.9.1)
nenv (0.3.0)
net-scp (2.0.0)
net-ssh (5.2.0, 3.1.1)
net-telnet (0.1.1)
nio4r (2.3.1)
nokogiri (1.10.3 x64-mingw32)
nori (2.6.0)
normalize-rails (3.0.3)
notiffany (0.1.1)
openssl (default: 2.1.2)
orm_adapter (0.5.0)
paperclip (4.3.7)
passenger (5.0.30)
pg (1.1.4 x64-mingw32, 0.18.4 x64-mingw32)
power_assert (1.1.1)
pry (0.12.2)
psych (default: 3.0.2)
rack (2.0.7, 1.6.11, 1.6.4)
rack-accept (0.4.5)
rack-mount (0.8.3)
rack-test (1.1.0, 0.6.3)
rails (5.2.3, 4.2.6)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (2.0.3, 1.0.9)
rails-html-sanitizer (1.0.4)
railties (5.2.3, 4.2.6)
rake (12.3.2, 12.3.0, 11.1.2)
rb-fsevent (0.10.3, 0.9.7)
rb-inotify (0.10.0)
rdoc (default: 6.0.1, 4.3.0)
responders (2.4.1)
rqrcode (0.10.1)
rspec (3.4.0)
rspec-core (3.4.4)
rspec-expectations (3.4.0)
rspec-mocks (3.4.1)
rspec-rails (3.4.2)
rspec-support (3.4.1)
ruby_dep (1.5.0)
rubygems-update (3.0.3)
sass (3.4.25, 3.4.21)
sass-rails (5.0.7)
savon (2.11.2)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
sdoc (0.4.2)
select2-rails (4.0.1.1)
selectize-rails (0.12.6, 0.12.1)
shellany (0.0.1)
simple_form (3.2.1)
slim (3.0.9)
slop (3.6.0)
socialization (1.2.3)
socksify (1.7.1)
spring (2.0.2, 1.6.4)
spring-commands-rspec (1.0.4)
sprockets (3.7.2)
sprockets-rails (3.2.1)
sshkit (1.18.2)
stringio (default: 0.0.1)
strscan (default: 1.0.0)
temple (0.8.1, 0.7.6)
test-unit (3.2.7)
thor (0.20.3, 0.19.1)
thread_safe (0.3.6, 0.3.5)
tilt (2.0.9, 2.0.2)
timecop (0.8.1, 0.8.0)
turbolinks (5.2.0)
turbolinks-source (5.2.0)
tzinfo (1.2.5)
uglifier (4.1.20)
virtus (1.0.5)
warden (1.2.7)
wasabi (3.5.0)
web-console (2.3.0)
webrick (default: 1.4.2)
websocket-driver (0.7.0)
websocket-extensions (0.1.3)
whenever (0.11.0)
xmlrpc (0.3.0)
zlib (default: 1.0.0)

如果您需要知道捆绑包中安装了什么及其版本:

$ bundle install
Using rake 12.3.2
Using aasm 4.10.1
Using concurrent-ruby 1.1.5
Using i18n 0.9.5
Using json 1.8.6
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 4.2.6
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.3 (x64-mingw32)
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.9
Using crass 1.0.4
Using loofah 2.2.3
Using rails-html-sanitizer 1.0.4
Using actionview 4.2.6
Using rack 1.6.11
Using rack-test 0.6.3
Using actionpack 4.2.6
Using globalid 0.4.2
Using activejob 4.2.6
Using mini_mime 1.0.1
Using mail 2.7.1
Using actionmailer 4.2.6
Using activemodel 4.2.6
Using arel 6.0.4
Using activerecord 4.2.6
Using acts_as_commentable 4.0.2
Using acts_as_list 0.7.4
Using execjs 2.7.0
Using autoprefixer-rails 6.7.7.2
Using thor 0.20.3
Using railties 4.2.6
Using momentjs-rails 2.20.1
Using datetime_picker_rails 0.0.7
Using jquery-rails 4.3.3
Using kaminari 0.16.3
Using sass 3.4.25
Using neat 1.9.1
Using normalize-rails 3.0.3
Using bundler 1.17.3
Using sprockets 3.7.2
Using sprockets-rails 3.2.1
Using rails 4.2.6
Using tilt 2.0.9
Using sass-rails 5.0.7
Using selectize-rails 0.12.6
Using administrate 0.2.2
Using gyoku 1.3.1
Using akami 1.3.1
Using aws-sdk-v1 1.67.0
Using aws-sdk 1.67.0
Using descendants_tracker 0.0.4
Using ice_nine 0.11.2
Using axiom-types 0.1.1
Using bcrypt 3.1.13
Using coderay 1.1.2
Using erubi 1.8.0
Using better_errors 2.5.1
Using debug_inspector 0.0.3
Using binding_of_caller 0.8.0
Using bootstrap-datepicker-rails 1.6.0.1
Using bootstrap-sass 3.3.7
Using bootstrap3-datetimepicker-rails 4.17.47
Using byebug 11.0.1
Using cancancan 1.17.0
Using net-ssh 5.2.0
Using net-scp 2.0.0
Using sshkit 1.18.2
Using capistrano 3.4.1
Using capistrano-bundler 1.5.0
Using capistrano-faster-assets 1.1.0
Using capistrano-passenger 0.2.0
Using capistrano-rails 1.1.8
Using capistrano-rvm 0.1.2
Using chronic 0.10.2
Using chunky_png 1.3.11
Using climate_control 0.2.0
Using cocaine 0.5.8
Using cocoon 1.2.9
Using coercible 1.0.0
Using coffee-script-source 1.12.2
Using coffee-script 2.4.1
Using coffee-rails 4.1.1
Using multi_json 1.13.1
Using compass-core 1.0.3
Using compass-import-once 1.0.5
Using rb-fsevent 0.10.3
Using ffi 1.11.1 (x64-mingw32)
Using rb-inotify 0.10.0
Using compass 1.0.3
Using compass-rails 3.0.2
Using daemons 1.2.6
Using database_cleaner 1.5.3
Using delayed_job 4.1.5
Using delayed_job_active_record 4.1.3
Using orm_adapter 0.5.0
Using responders 2.4.1
Using warden 1.2.7
Using devise 3.5.10
Using diff-lcs 1.3
Using dotenv 2.1.2
Using dotenv-rails 2.1.2
Using equalizer 0.0.11
Using exception_notification 4.1.1
Using factory_girl 4.5.0
Using factory_girl_rails 4.5.0
Using faker 1.6.6
Using formatador 0.2.5
Using hashie 3.6.0
Using multi_xml 0.6.0
Using rack-accept 0.4.5
Using rack-mount 0.8.3
Using virtus 1.0.5
Using grape 0.15.0
Using grape-entity 0.4.8
Using grape-swagger 0.10.5
Using grape-swagger-rails 0.2.2
Using ruby_dep 1.5.0
Using listen 3.1.5
Using lumberjack 1.0.13
Using nenv 0.3.0
Using shellany 0.0.1
Using notiffany 0.1.1
Using method_source 0.9.2
Using pry 0.12.2
Using guard 2.15.0
Using guard-compat 1.2.1
Using rspec-support 3.4.1
Using rspec-core 3.4.4
Using rspec-expectations 3.4.0
Using rspec-mocks 3.4.1
Using rspec 3.4.0
Using guard-rspec 4.6.5
Using hashie-forbidden_attributes 0.1.1
Using socksify 1.7.1
Using httpi 2.4.4
Using jbuilder 2.9.1
Using mime-types-data 3.2019.0331
Using mime-types 3.2.2
Using mimemagic 0.3.0
Using nori 2.6.0
Using paperclip 4.3.7
Using passenger 5.0.30
Using pg 0.18.4 (x64-mingw32)
Using rdoc 4.3.0
Using rqrcode 0.10.1
Using rspec-rails 3.4.2
Using wasabi 3.5.0
Using savon 2.11.2
Using sdoc 0.4.2
Using select2-rails 4.0.1.1
Using simple_form 3.2.1
Using temple 0.8.1
Using slim 3.0.9
Using socialization 1.2.3
Using spring 2.0.2
Using spring-commands-rspec 1.0.4
Using timecop 0.8.1
Using turbolinks-source 5.2.0
Using turbolinks 5.2.0
Using uglifier 4.1.20
Using web-console 2.3.0
Using whenever 0.11.0
Bundle complete! 57 Gemfile dependencies, 167 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

如果有人可以帮助指导我为 ruby 设置服务器数据库,那就太好了。谢谢!

pggem 需要很少的软件包来安装它。

您没有指定系统,因此以下是几个示例:

Debian/Ubuntusudo apt-get install libpq-dev

Mac它带有 postgresqlbrew install postgresql

Windows我将指向不同的 SO 线程:无法在Windows上安装 pg gem

相关内容

最新更新