Ruby on Rails: LoadError: cannot load such file -- paypal-express

Ruby on Rails: LoadError: cannot load such file -- paypal-express

当我做的时候

rake db:migrate

它只是失败了。这是日志:

$ rake db:migrate
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/object/duplicable.rb:82: warning: BigDecimal.new is deprecated; use BigDecimal() method instead.
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated
rake aborted!
SystemStackError: stack level too deep
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/core_ext/numeric/conversions.rb:131:in `block (2 levels) in <class:Numeric>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rest-client-2.0.2/lib/restclient/version.rb:3:in `map'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rest-client-2.0.2/lib/restclient/version.rb:3:in `<module:RestClient>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rest-client-2.0.2/lib/restclient/version.rb:1:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rest-client-2.0.2/lib/restclient.rb:7:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rest-client-2.0.2/lib/rest_client.rb:2:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/paypal-express-0.8.1/lib/paypal.rb:6:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/paypal-express-0.8.1/lib/paypal/express.rb:1:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:95:in `require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:95:in `rescue in block in require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:72:in `block in require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `each'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bundler-1.17.3/lib/bundler.rb:114:in `require'
/home/ubuntu/myproject/RubyOnRails/config/application.rb:7:in `<top (required)>'
/home/ubuntu/myproject/RubyOnRails/Rakefile:4:in `require'
/home/ubuntu/myproject/RubyOnRails/Rakefile:4:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
/home/ubuntu/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'

Caused by:
LoadError: cannot load such file -- paypal-express
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:81:in `require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:76:in `each'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:76:in `block in require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `each'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bundler-1.17.3/lib/bundler/runtime.rb:65:in `require'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bundler-1.17.3/lib/bundler.rb:114:in `require'
/home/ubuntu/myproject/RubyOnRails/config/application.rb:7:in `<top (required)>'
/home/ubuntu/myproject/RubyOnRails/Rakefile:4:in `require'
/home/ubuntu/myproject/RubyOnRails/Rakefile:4:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
/home/ubuntu/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'
(See full trace by running task with --trace)

我尝试了 this 答案中给出的建议:

  1. 我的 Gemfile
  2. 中已经有 gem 'paypal-express'
  3. 我是手动安装的paypal-expressgem:

    gem 安装 paypal-express

仍然没有运气。 this question 的提问者给出的线索是:

I needed to create the model from the terminal so I can run my migration

但我不知道该怎么做(如果我想尝试的话)。 任何帮助将非常感激。 我是 RoR 新手。

我意识到这个问题的根本原因是因为我忘记导入数据库(换句话说,我的数据库是空的)。我知道这是一个愚蠢的错误,但我仍然将它张贴在这里,以防它可以帮助将来来这里的人。我通过这样做导入了数据库:

sudo mysql -u root -p <db name> < /home/ubuntu/my_site_data.sql