First let me say I cannot do gem install, I don't know why. Probably because I live in China and the firewall random things.
So I have to locally install gems. For example, i want to install this gem riddle. But this gem downloads as a tar or zip and when i open it it is a folder not a .gem file.
So what to do?
Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.
By default, binaries installed by gem will be placed into: /usr/local/lib/ruby/gems/3.1. 0/bin You may want to add this to your PATH.
You can do gem build whatever.gemspec
inside of the directory that you untar/unzip -- that will produce a .gem
file, then do gem install whatever.gem
.
You need to be at the directory where you unzip the gem file for example
C:\railsinstaller\ruby2.2.0\lib\ruby\gems\2.2.0\gems> gem install rails-5.0.0.1.gem
and that's it - you are done downloading and installing Rails.
To avoid the gem build
step, and to always run the actual code, bundler can install from a local path:
gem 'pry', path: './pry'
in a Gemfile.
... where ./pry
would be the clone of your repository.
Simply run bundle install
once, and any changes in the gem sources you make are immediately reflected. With gem build pry / gem install pry/pry.gem
, the sources are still moved into GEM_PATH and you'll always have to run both gem build pry
and gem update
again if you make changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With