Ruby on Rails: LoadError: не может загрузить такой файл - paypal-express - PullRequest
0 голосов
/ 28 октября 2019

Когда я делаю

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)

Я попробовал предложения, приведенные в этом ответе:

  1. У меня уже есть гем 'paypal-express' в моем Gemfile
  2. Я установил вручную paypal-express gem:

    gem install paypal-express

Все еще не повезло. Спрашивающий этот вопрос дал подсказку, что:

Мне нужно было создать модель из терминала, чтобы я мог запустить свою миграцию

Но я делаюне знаю, как это сделать (если я хочу попробовать). Любая помощь могла бы быть полезна. Я новичок в RoR.

1 Ответ

0 голосов
/ 06 ноября 2019

Я понял, что основной причиной этой проблемы было то, что я забыл импортировать БД (другими словами, моя БД была пуста). Я знаю, что это глупая ошибка, но я публикую ее здесь на случай, если это поможет кому-то прийти сюда в будущем. Я импортировал БД, выполнив это:

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