简体   繁体   中英

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

When I do

rake db:migrate

It simply fails. Here is log:

$ 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)

I tried suggestions given in this answer:

  1. I am already having gem 'paypal-express' in my Gemfile
  2. I manually installed paypal-express gem:

    gem install paypal-express

Still no luck. Questioner of this question given clue that:

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

But I do not know how to do that (if I want to try it). Any help would be really appreciated. I am new to RoR.

I realized root cause of this problem was because I had forgotten to import DB (In other words, my DB was empty). I know it's silly mistake still I am posting it here in case it could help someone coming here in future. I imported DB by doing this:

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

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.

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