Can't install the "refinerycms-memberships" gem - ruby-on-rails

What can i do if i know there is a github repository for the gem but in the terminal i couldn't install the gem via 'gem install' or 'bundle install' because it fails with the following error:
Could not find gem 'refinerycms-memberships (= 1.0)' in any of the gem sources listed in your Gemfile.
I couldn't find it on rubygems.org either, so is there any other way of getting it installed :(

If you're using bundle install then I assume you're installing using a Gemfile. In this case, you can specify a git repo:
gem refinerycms-memberships, :git => "git://path.to/git/repo"

Specifically for this gem, I found this line in my Gemfile to work for me:
gem 'refinerycms-memberships', '~> 2.0.0', :git => 'https://github.com/rbriank/refinerycms_membership.git'
Depending when you see this post, you might need to modify the version or possible add the
:branch => .... option.

Related

Could not find gem 'aws-3' in any of the gem sources listed in your Gemfile or available on this machine

I'm new to RoR and I keep getting this error when trying to install Amazon gem aws-3:
Could not find gem 'aws-3' in any of the gem sources listed in your Gemfile or available on this machine.
I'm using Rails 5.
The gem per se appears to successfully be installed:
$ gem install aws-s3
Successfully installed aws-s3-0.6.3
Parsing documentation for aws-s3-0.6.3
Done installing documentation for aws-s3 after 1 seconds
1 gem installed
Added it to my Gemfile:
gem 'aws-3', :require => 'aws/s3'
On the top of the Gemfile I have listed:
source 'https://rubygems.org'
You misspelled aws-s3 as aws-3in the Gemfile. It should be
gem 'aws-s3', :require => 'aws/s3'
Note: There's no gem which goes by the name aws-3. That is why you were getting the error.
As told by #Arun Kumar,
you need to add aws-s3 gem in your gemfile.Here is the github

bundler installs the country_select gem from the wrong source

In my Rail 3.2.13 gemfile I have added the country_select gem
gem 'country_select', :git => 'git://github.com/stefanpenner/country_select.git'
Rrunning bundle install however loads the wrong version of the gem. It instead loads the out-dated repository at https://github.com/rails/country_select
This happens in my development environment as well as when deploying my app to Heroku.
I was able to overcome this in my dev environment by using the ruby gem specific_install however that doesn't help with heroku.
Any ideas?
You have to update your Gemfile.lock with the git path:
bundle update country_select
It should do the trick.
You can set the branch you want to use on the remote git repository using:
gem 'country_select', :git => 'git://github.com/stefanpenner/country_select.git', branch: 'master'
or event a commit tag:
gem 'country_select', :git => 'git://github.com/stefanpenner/country_select.git', revision: 'commit_tag_here'
Beside, when running in Production, a good practice is to fix your gem versions in order to avoid unwanted gem updates.

alternative for github : <repo-name> in gem file

I am trying to build the docrails in my system. When I clone the repo and do bundle install as the guides say.
I get the following error
You passed :github as an option for gem 'rails/active_record_deprecated_finders'
, but it is invalid.
Entry in gemfile looks like this:
gem 'rails/active_record_deprecated_finders', github: 'rails/active_record_deprecated_finders'
To avoid that what I am doing is commenting the rest of the line like this:
gem 'rails/active_record_deprecated_finders'#, github: 'rails/active_record_deprecated_finders'
Then it foregoes that and the next problem arrives with the error message saying:
Could not find gem 'active_record_deprecated_finders (>= 0) x86-mingw32' in any
of the gem sources listed in your Gemfile.
Environment specs:
Bundler version 1.0.21
Rails 3.2.3
Win7 64bit
Question
I dont know why its looking for x86 when my System is 64bit.Is there any work around for this? or its a bug?
If gem file couldn't accept github: as parameter why is it there in the first place?
Please let me know if there are any workarounds to this problem
The :github option is just shorthand for a longer :git option:
gem :foo, :github => 'rails/foo'
Is just short for
gem :foo, :git => 'git://github.com/rails/foo.git'
This is new in bundler 1.1 which is why it doesn't work on your setup. You could rewrite the gemfile but it would probably be easier to update bundler. In addition bundler 1.1 is a lot faster than 1.0

Bundle install doesn't work

I'm trying to install all gems in a gemFile of a project, but when i typed:
sudo bundle install
but i got this error:
Could not find gem 'llrp_connector (>= 0)' ruby in any of the gem sources listed in your Gemfile.
Anyone have an idea ?
Have you added this line on the top of your Gemfile?
source 'http://rubygems.org'
EDIT
As Dylan said, this gem doesn't exist on RubyGems.org. If it is a gem hosted on a (private) repository, add it this way :
gem "nokogiri", :git => "git://github.com/tenderlove/nokogiri.git", :branch => "1.4"

'Could not find gem' error when specifying a forked version of a gem from Github in my gemfile

I am trying to use this forked version of the searchlogic gem. In my gemfile, I have
gem "searchlogic", :git => "http://github.com/railsdog/searchlogic.git"
when I do bundle install, I get this error:
Could not find gem 'searchlogic (>= 0, runtime)' in http://github.com/railsdog/searchlogic.git (at master).
Source does not contain any versions of 'searchlogic (>= 0, runtime)'
What is causing this error? Thanks for reading.
It's because your fork not define searchlogic gem by rd_searchlogic gem. So use in your Gemfile :
gem "rd_searchlogic",
:git => "rd_searchlogic.gemspec",
:require => "searchlogic"
Use:
gem 'rd_searchlogic', :git => 'https://github.com/railsdog/searchlogic.git', :require => 'searchlogic'
The .gemspec of your fork might contain a different name to that of the gem on RubyGems, for example when I forked active_merchant on GitHub their .gemspec file had:
s.name = 'activemerchant'
but the gem is defined as active_merchant on RubyGems so I changed my Gemfile from:
gem "active_merchant", git: "https://github.com/adamwaite/active_merchant.git", require: "active_merchant"
to:
gem "activemerchant", git: "https://github.com/adamwaite/active_merchant.git", require: "active_merchant"
note the lack of _.
All worked perfectly after that. This may be an obscure case, but hope it helps someone!
It doesn't look like that gem has been upgraded for Rails3. From the issues listed in Github, it seems that searchlogic is heavily dependent on ActiveRecord2 and may not be easily upgraded for Rails 3. It may be worth looking into an alternative.
Will searchlogic work with Rails 3?
http://github.com/binarylogic/searchlogic/issues/issue/65

Resources