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.
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.
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
For me, (I am working with RVM) it worked just running:
gem update --system
gem update bundler
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
Try run through the bundle
cd myapp
gem install bundler
bundle install
bundle exec rake db:create