Rails 2.2.2 issue: undefined method `activate_bin_path' for Gem:Module (NoMethodError)

后端 未结 5 890
时光取名叫无心
时光取名叫无心 2020-12-17 08:49

I am working on Rails 2.2.2 application. For this I installed rvm with Ruby version 1.9.3p551. There is no Gemfile for this application. So as mentioned in the environment.

相关标签:
5条回答
  • 2020-12-17 09:24

    I had a similar issue, when running the standalone passenger, it worked fine. However, running it using a systemd service gave the same error as the OP:

    undefined method `activate_bin_path' for Gem:Module (NoMethodError)
    

    I've managed to solve it using

    env | egrep 'gem|rvm|ruby' > passenger.env
    

    and adding it to the service file using EnvironmentFile=[...]/passenger.env.

    Hopefully, this will be useful for other people stuck on this.

    0 讨论(0)
  • 2020-12-17 09:27

    Have you tried these commands

    Rename /usr/lib/ruby/site_ruby/ to site_ruby.bak/ Run the following commands:

    gem install rubygems-update
    enter code here
    update_rubygems
    

    If you get error then try the following instead:

    ruby --disable-gems -S update_rubygems

    0 讨论(0)
  • 2020-12-17 09:32

    For me, (I am working with RVM) it worked just running:

    gem update --system
    gem update bundler
    
    0 讨论(0)
  • 2020-12-17 09:36

    This normally occurs when you have multiple versions of RVM and gem sets and its normally comes for ruby 2.2.2 the best way to get rid of this ERROR is.

    First Update your system gems by using the following

     gem update --system   
    
     OR  
    
     update_rubygems --system
    

    Then you have to update your bundler:

     gem update bundler
    
    0 讨论(0)
  • 2020-12-17 09:42

    Try run through the bundle

    cd myapp
    gem install bundler
    bundle install
    bundle exec rake db:create
    
    0 讨论(0)
提交回复
热议问题