Not able to run/install Gems using Gemfile - ruby-on-rails

When i give bundle install or bundle exec i am getting this error
Could not find gem 'acts_as_ferret-0.4.4.gem (>= 0) ruby' in any of the gem sources listed in your Gemfile.
Apparently the first gem in the Gemfile is acts_as_ferret-0.4.4 and source is
source 'http://rubygems.org'
I tried other sources also but still not working!!!

As Pete is saying there probably is a problem with your gemfile
Try to open it and see if your acts_as_ferret looks something like this.
gem "acts_as_ferret", "~> 0.5.3"
if not try and change it to the above
There is more info to be found on the gem on the github page
https://github.com/jkraemer/acts_as_ferret

Looks like your gem identifier is misstyped if it cannot be found even if you try different sources. Did you try to remove the (>=0) ? I think that just says, 'get me any version' but you already specify the version as 0.4.4. Also I'm not too sure about the 'ruby' addition.
Here the gem is listed as acts_as_ferret-0.4.4.gem

Related

Problem when installing rails on windows?

I am trying to create new demo rails program, as guide in my book as this command
rails new demo
then it gave me this error
https://imgur.com/rUSzO4B
It said that my problem is
Could not find gem sqlite3 <> 1.4 x86-mingw32 in any of the gem sources listed in your Gem file
and I must run
bundle install
to solve it
I ran bundle install , but nothing changed.
I know my question maybe too easy to solve, but I am very stuck with this, could you please give me some ideas?
From the documentation of the bootsnap gem in rails: "This gem works on macOS and Linux." See: https://github.com/Shopify/bootsnap
They seem to have found a workaround here:
How can I properly install bootsnap on windows
Add or change to gem 'bootsnap', '=1.4.1', require: false to your project Gemfile

Unable to install Doorkeeper-MongoDB

I have a fresh installation of rails 4 with MongoMapper. Now i'm trying to install doorkeeper on my rails instance.
I added the "gem 'doorkeeper-mongodb'" line in my Gemfile. Then I ran 'bundle install'. And I got the following error :
Could not find gem 'doorkeeper-mongodb (>= 0) ruby' in any of the gem sources listed in your Gemfile or available on this machine.
Also, I tried to install it using the gem install command but it doesn't work either.
I'm on Mac OS X.
The line to put in the Gemfile is
gem 'doorkeeper-mongodb', github: 'doorkeeper-gem/doorkeeper-mongodb'
I tried checking the gems in https://rubygems.org and could not find doorkeeper-mongodb.
And then googled out, and found that if you want to install gems from github source, then the right way seems like this following:
gem 'doorkeeper-mongodb', :git => 'git://github.com/doorkeeper-gem/doorkeeper-mongodb.git'
Or you can also download the source from github, and install it from local.

bundle install failing for 'letter-opener' gem in rails

I am trying to use Ryan Bates 'letter-opener' gem as described in Episode #104 (and in many other places on the web) In every instance I have found, it appears that users are simply including the gem in their Gem file with the traditional ruby gems gemsource. When I attempt this, rails fails to find the gem. I must be doing something wrong, but what?
source "http://rubygems.org"
...
gem "letter-opener", group: :development
Then I type
$ bundle install
and I receive the following message:
Fetching source index for http://rubygems.org/
Could not find gem 'letter-opener (>= 0) x86-mingw32' in any of the gem sources listed in > your Gemfile.
Thanks for the help!
It's a common error to mistype a compound-word rubygem with an underscore ('_') instead of a hyphon ('-') or viceversa.
If you ever find this problem, you can go to http://rubygems.org, and search for the gem's name.
In this case, searching for letter opener returns this result, which suggests that the gem is actually called letter_opener
use gem 'letter_opener'instead of gem 'letter-opener'.

Getting gcal4ruby gem to work

I'm trying to create a RoR web application that allows people to connect to their accounts to google calendar.
I found a gem called gcal4ruby that seemed to do the right things based on looking at sample code and its documentation.
I ran gem install and the cmd claimed the installation was ok.
However, when I added the gem to my gemfile then try to run the server again I get:
Could not find 'gcal4ruby (= 0.0.5, runtime)' in any of the gem sources
Try running 'bundle install'.
Then I tried bundle install which basically gets me the message above and a line:
Fetching source index for http://rubygems.org/
Could not find 'gcal4ruby (= 0.0.5, runtime)' in any of the gem sources
Yet when I type in "gem list -d g", gcal4ruby (0.5.5) appears on the list.
I've tried adding in requires and includes but that just gets me uninitialized constant errors.
Other details that may be relevant:
ruby 1.8.7
rails 3.0.1
gem check --alien returns:
mysql-2.8.1-x86-mingw32 has 1 problems
.require_paths:
Extra file
*Note: This doesn't seem to negatively impact me when I'm doing anything though.
If possible, please supply tutorials/sites with samples of working code.
Cheers,
Zigu
Could you post your gemfile please?
I'm guessing your Gemfile reads
gem 'gcal4ruby', '0.0.5'
which means it will only look for that specific verison. So there are two ways to fix this.
Change it to minimum version syntax
gem 'gcal4ruby', '>= 0.0.5'
Change to correct specific gem version
gem 'gcal4ruby', '0.5.5'
Hope that helps

Specify a plugin as gem from github in Gemfile

I am including 'acts_as_rateable' gem in my Gemfile like this
gem 'acts_as_rateable', :git => 'git://github.com/azabaj/acts_as_rateable.git'
and then when I do bundle install it gives me this error message!
Could not find gem 'acts_as_rateable
(>= 0, runtime)' in
git://github.com/azabaj/acts_as_rateable.git
(at master). Source does not contain
any versions of 'acts_as_rateable (>=
0, runtime)'
I am developing a plugin of my own, when I include that, even that gives the same error like this..
I assume this has something to do with the gemspec?
Please help
Rails version : 3.0.1
Rubygems version : 1.3.7
Bundler version : 1.0.3
let me know if you need any other details..
If you want to pull a gem directly from GitHub, you can put this into your GemFile:
gem 'twitter', github: 'sferik/twitter'
Which will use the default branch. To specify the branch to use:
gem 'twitter', github: 'sferik/twitter', branch: 'branch_name'
The problem is that the repository you link to is not a RubyGem. You can get with
$ rails plugin install git://github.com/azabaj/acts_as_rateable.git
Edit: This answer was accurate on the date it was published. Rails 4 doesn't support plugins anymore, so you will have to make this into a local gem yourself. Bundler has some commands that will help you with it, or alternatively you can use a different library, e.g. https://github.com/anton-zaytsev/acts_as_rateable.
Jakub Hampl is right, but it seems strange to depend on git repos like that. I guess you're you making it yourself? If so, make it a real gem. It should have a acts_as_rateable.gemspec and you'll be able to depend on it like you wrote. Bundler makes your life easy, create the gemspec with
$ bundle gem acts_as_rateable

Resources