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

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

Related

Source does not contain any versions of 'rails-assets-lodash (~> 2.4)

I'm trying to help debug a project. I'm getting a really weird error when I try to run the server. I tried to google the gem but no luck. Anyone have any ideas? I tried bundle install and bundle update.
Here is the actual block of code I'm trying to run.
source 'https://rails-assets.org' do
# Assets via Bower
gem 'rails-assets-lodash', '~> 2.4'
gem 'rails-assets-angular', '~> 1.2'
gem 'rails-assets-angular-spree', '= 0.0.2'
end
error: Source does not contain any versions of 'rails-assets-lodash (~> 2.4) ruby' Run bundle install to install missing gems.
If I comment out the first gem I get similar error with the gem proceeding it. When I comment out the block it does work though, but I was instructed not to change the environment.
If you are using Bundler 1.8.0-1.8.2, you are probably hitting this bug: https://github.com/bundler/bundler/issues/3414
This should be fixed in Bundler 1.8.3 (released today).

Using bundler to compile gems hosted on github?

So, many people like to fork gems and add features to them etc.. that is fine. but it makes trying their gem a bit of work if you have to clone teh gem yourself, download it, install, etc.
I'd like to be able to have bundler compile the gem for me if there is no pkg/gem_name.gem file
This is what I'm doing currently:
gem "yard-rest-plugin", :git => "git://github.com/ql/yard-rest-plugin.git"
And then the bundle update error:
Could not find gem 'yard-rest-plugin (>= 0) ruby' in git://github.com/ql/yard-rest-plugin.git (at master).
Source does not contain any versions of 'yard-rest-plugin (>= 0) ruby'
Hence why it would be nice if it auto-compiled.
Looks like the name of the gem is gem 'yard-rest' so this should work:
gem "yard-rest", :git => "git://github.com/ql/yard-rest-plugin.git"
https://github.com/ql/yard-rest-plugin

Installing cancan 2.0 gem in Rails 3.1

I'm having trouble installing the cancan 2.0 gem in Windows XP. I am using Rails 3.1 and in my gemfile y have
gem "cancan", :git => "git://github.com/ryanb/cancan.git", :branch => "2.0"
but it keeps saying
No such file or directory - git clone
"git://github.com/ryanb/cancan.git"
My teammates are not having this problem, but the are working in Unix systems.
It sounds like your git is not working properly. Are you using any other git references in your Gemfile?
I copied and pasted the exact same thing in my gemfile and it worked just fine.
gem 'cancan', github: 'ryanb/cancan', branch: '2.0'

Can't install the "refinerycms-memberships" gem

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.

'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