Unable to install any ruby gems - ruby-on-rails

I am trying to install Rails on my Mac. I keep getting a Jruby error or something of the sort:
gem install rails
Loading jruby-openssl in a non-JRuby interpreter
Error loading RubyGems plugin "/Users/User/.rvm/gems/ruby-2.4.0#global/gems/executable-hooks-1.3.2/lib/rubygems_plugin.rb": cannot load such file -- jruby (LoadError)
Loading jruby-openssl in a non-JRuby interpreter
Error loading RubyGems plugin "/Users/User/.rvm/gems/ruby-2.4.0#global/gems/gem-wrappers-1.2.7/lib/rubygems_plugin.rb": cannot load such file -- jruby (LoadError)
Loading jruby-openssl in a non-JRuby interpreter
ERROR: Loading command: install (LoadError)
cannot load such file -- jruby
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
It looks like I have JRuby installed, which I think happened after I installed Java to install Netbeans. I used RVM to update ruby to 2.4. How do I get back to installing gems?
Thanks

rvm get stable --auto-dotfiles

Related

Issue on Installing Ruby On Rails for specific version on Ubuntu 18.04

I had installed Ruby at the version of 2.7.0 and Gem at the version of 3.1.2 when I used the command " gem install rails " it shows an error like this..
Log:
ax#shivvv:~$ sudo gem install rails
[sudo] password for ax:
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
ax#shivvv:~$
Help me to find it..

bundler always not found when switched ruby version

i am using rvm and my default ruby is the latest Ruby , but i want to swith ruby version to 2.3.8
and after i run rvm use ruby2.3.8 and i want to run bundle install it said bundle not found, and then i tried to install bundle gem install bundler
then error i got is:
ERROR: Loading command: update (LoadError)
cannot load such file -- openssl
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
i already re install rvm and read some question about that error on this SO to get openssll ( my openssl already installed by brew ) such this question
is there any way to solve this?

Trouble installing Rails on MacOS

I have Ruby 5.2.3, Homebrew, Xcode, and zlib 1.2.11 installed but I am still running into this error:
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
I've tried running
gem install rails -v 5.2.3
gem install rails
and
sudo gem install rails
and all give the same error.

gem - v or gem install bundler giving error rails

Currently on my system i have installed rbenv and rvm both. when i do which ruby it gave me this /home/ijunaidfarooq/.rbenv/shims/ruby and on which rails it gave me /home/ijunaidfarooq/.rbenv/shims/rails.
but on doing gem install bundler it installs the gem but with an error
Error loading RubyGems plugin "/home/ijunaidfarooq/.rvm/gems/ruby-2.2.2#global/gems/executable-hooks-1.3.2/lib/rubygems_plugin.rb": cannot load such file -- executable-hooks/wrapper (LoadError)
Error loading RubyGems plugin "/home/ijunaidfarooq/.rvm/gems/ruby-2.2.2#global/gems/gem-wrappers-1.2.7/lib/rubygems_plugin.rb": cannot load such file -- gem-wrappers (LoadError)
as its showing that its going for .rvm/gems as per which ruby and which rails , its going in .rbenv/shims
even on doing gem -v its giving me this
Error loading RubyGems plugin "/home/ijunaidfarooq/.rvm/gems/ruby-2.2.2#global/gems/executable-hooks-1.3.2/lib/rubygems_plugin.rb": cannot load such file -- executable-hooks/wrapper (LoadError)
Error loading RubyGems plugin "/home/ijunaidfarooq/.rvm/gems/ruby-2.2.2#global/gems/gem-wrappers-1.2.7/lib/rubygems_plugin.rb": cannot load such file -- gem-wrappers (LoadError)
2.4.5
application is working totally fine on localhost but when i update some gems and deploy on awselasticbeanstalk , it gives me error which is
cannot load such file -- bundler/setup
any help will be appreciated.

Failed to install Rails on yosemite

I installed Ruby via rbenv. Currently, my pc has ruby 2.1.2p95 version installed. I have just started development in rails. So, don't know much about it.
But, I get some kind of error when I installed it.
$gem install rails -v 4.2.0
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
Did you run rbenv rehash after installing that version of ruby? Perhaps your PATH is pointing to the wrong gem command?
I've run into something similar.
Try
xcode-select --install
Than perhaps give this a go if it still doesn't work:
rbenv uninstall 2.1.2p95
rbenv install 2.1.2p95

Resources