Run "Bundle Install" w/o Installing a Specific Dependency Gem - Rails - ruby-on-rails

I'm trying to run bundle on a Win machine for an existing app. One of the gems is using HiRedis as a dependency. Since it is impossible to install HiRedis on Win:
Is there a way to find out which gem is using HiRedis?
Is there a way to run bundle command with --without [hiredis]?

You can find the gem which uses the hiredis, from the Gemfile.lock. Search for hiredis, and check to see under which Gem is that hiredis appearing.

Related

I can't run rails server

how's going?
I trying to create my first application with Ruby on Rails, I can create the project but I can't run the server.
My OS is Windows.
I installed Node, Yarn, Ruby, Rails, Sqlite3.
This message appears when I try to run "rails s"
Could not find gem 'sqlite3' in locally installed gems.
Run `bundle install` to install missing gems.
I run the command "bundle install", "bundle update" and doesn't work. This message appears when I run "bundle install":
An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue.
In Gemfile:
sqlite3
When I verify the version of sqlite3:
enter image description here
I tried editing Gemfile:
gem 'sqlite3', '~> 1.4.2'
And tried install this way:
gem install sqlite3 -v '1.4.2' --source 'https://rubygems.org/'
I tried this steps too:
https://www.youtube.com/watch?v=cAseoJeNG8I
I follow the recommendation in the documentation for windows users and run "bin/rails s" on Bash, but still the same problem.
I read other answers here to similar questions but did not help me, for this I ask with this.
If something was a miss to you understand the problem please tell me and I provide the information.
Thanks, everyone.
The above Error occurred because sqlite3 is not installed on your system.
Step1:- First, install the sqlite3 on your system by following the steps mention here
Step2:- Run bundle install
Have you tried deleting gemfile.lock? Try delete and after that again type bundle install

Rails: purpose of downloading gems locally

Generally, if I need a gem, I put it in the Gemfile and bundle install. However, I don't understand if there is a benefit to downloading the gems locally first with gem install _____. Is there any benefit to this? Does bundle install no longer have to connect to the net in that situation?
Bundler installs the gems located in your Gemfile locally the same as if you ran gem install for each of those gems.
Gem install needed for gems that can be used outside of bundler applications. For example request-log-analyzer need to be installed outside of any apps for be available in command line.
I myself use gem install _______ then i use bundle install --local which doesn't require internet connection if the gem is found locally but will return an error if the gem was not found locally...
I find this method faster in downloading and installing gems, plus if the gems are found locally then i have also the benefit of altering the gemfile and install the gems without having internet connection.

install gem from command line vs changing gemfile

I'm trying to understand what exactly happen when I'm installing gems.
At first I thought that using the "gem install gem_name" command (and after it the "bundle install) will make sure I have the proper files and dependencies and then it will update the gemfile.
But I've noticed that whenever I add gem using the commend line it doesn't appears at the gemfile yet I'm still able to use its functionality.
so is there is any reason to use the comment "gem install gem_name" insted of just adding the gem name to the gemfile?
The reason to use a Gemfile is that you can install all required gems in a single go.
Imagine that you work in a development team and a new member starts contributing to your application.
Al he has to do is checkout the repository and run bundle install.
Only use the command gem install if you just want to install a gem that is not nessecarily relevant to your project.
If the project requires the gem; put it in the Gemfile.

Why would bundle install try to install linecache19?

I am trying to run "bundle install". It tries to install linecache19 version 0.5.13 which is not yet released. I can't find the linecache19 gem in Gemfile. Its getting installed as a dependency of some other gem. I would like to know what linecache19 gem is used for and who requires it.
You can run gem dependency GEMNAME on each of the gems in your gemfile (and possibly on their dependencies) to see who is requiring linecache19 0.5.13.
Maybe someone else will know of a way to search the whole dependency tree in one go.

I'm having trouble running my Rails web server

I have installed ruby193 and I've installed rails via the command prompt (I also installed a DevKit). However, whenever I try the command:
rails server
I get this error:
←[31mCould not find gem 'jquery-rails (>= 0) x86-mingw32' in the gems available
on this machine.←[0m
←[33mRun `bundle install` to install missing gems.←[0m
I've tried a bundle install and it gives me an error with when trying to install the json gem. Any suggestions?
make sure in your Gemfile you are including the right gem (no misspellings, etc)
Looks like you are on Windows.
I defeated the very same problem on Windows by manually installing my gems from Gemfile (gem install gem_to_install). After successfully installing a particular gem I ran bundle check to see what else I need to install. And this way after few installed gems I ran bundle check again and saw the output The Gemfile's dependencies are satisfied.
And then server started. I wish you the same!
P.S. You can install few gems at once: gem install gem1 gem2.

Resources