How to set up the Twitter gem in my Rails app? - ruby-on-rails

I have installed Ruby on Rails on my computer. I would like to create twitter API with Ruby on Rails.
I downloaded this gem zip file also:
I have Twitter API token and key.
I don't know how to move up.

Do the following to add the Twitter gem to your app:
Open your Gemfile and add this: gem 'twitter', '~> 5.16'
Type bundle install at the command line (making sure you're in the
directory of your Rails app) and hit enter.
You should see some messages relating to gem installation.

Related

How to use Google Calendar from Ruby On Rails

Anyone has a recent good start (or course) to access a Google Calendar from ROR and manipulate it. I managed to login via the 'omniauth-google-oauth2' gem but cannot succeed using the 'google-api-client' or is there another way? I'm new to Ruby and ROR.
didn't work with G. calendara but maybe try this gem https://github.com/northworld/google_calendar
so open Gemfile
# Gemfile
# ...
gem 'google_calendar'
# ...
then run
bundle install
that should install the gem, then just follow the instructions in Readme

Add rb-grib gem to Rails application

I'm new to Rails and I got a problem.
My new project requires rb-grib gem (link to ruby gems: https://rubygems.org/gems/rb-grib/versions/0.2.2). This gem requires GRIB API library, I installed it using brew install grib-api. It works in irb and .rb scripts. I need to use it in my Rails app, but I get an error LoadError: cannot load such file -- numru/grib. What I need to do to make it work and deploy to Heroku in future?
You need to add
require 'numru/grib'

cannot load such file -- mongo_mapper/document

I am receiving the following error message when attempting to authenticate with Facebook in a rails app using MongoMapper:
It appears that MongoMapper is not being loaded properly, but I am not sure why. In my Gemfile I include gem 'mongo_mapper, gem 'bson_ext', and gem 'omniauth-facebook', '~> 1.4.1'. I also followed the setup instructions here: http://mongomapper.com/documentation/getting-started/rails.html to completion. I am able to run the $ mmconsole, as well as connect to the mongod using the $ mongo. Is there another configuration step that I missing to ensure that mongo_mapper can be loaded properly? Thanks in advance for any assistance, I am new to MongoDB in general.
EDIT:
Here is what my SessionsController looks like, where the LoadError originates:

Trying to install survey Gem

I am following these guides:-
http://www.runtime-revolution.com/runtime/blog/introducing-survey
When I try:-
gem "survey", "~> 0.1"
as it suggests I get:-
ERROR: While executing gem ... <RuntimeError>
Unknown command survey,
When I try:-
gem install survey
It says that everything has installed fine but when I try:-
Rails generate survey plain namespace:contests
or
rails generate survey:install
I get :-
Could not find generator
Also, looking in my Gemfile survey is not in there?
gem "survey", "~> 0.1"
Is not a command. This is the line you need to manually add to your Rails Gemfile to list the gem as dependency in your Rails application, as also explained in the README you linked.
After you add it, run
$ bundle
and the gem will be installed in your Rails application.
As a side note, you may also benefit from reading some introductory book about using Ruby and Rails.

Where are the gem files located?

Where are the gem files located ?
I'm new to rails and trying o understand how the whole gem functionality works.
My question is how can i follow a gem installation in order to confirm a gem is been installed ?
Where are the installed files located ?
From within your rails app, you can list out all of the gems being used, their versions, and the local path:
bundle show --paths
There's no reason to modify any of these files though. Configuration is typically done through an initializer in /app/initializers, but it depends on the gem being used.
If you need to modify something about the gem, you should fork it on Github and then reference the git location in your Gemfile until your pull request makes it back into the gem:
gem 'some_gem', '4.1.1', git: 'https://github.com/some_github_repo/some_gem.git'

Resources