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
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'
I am having multiple issues getting locomotivecms-search to run.
First one is that after I have added the locomotive-search gem and ran the install with the bundler which has installed the gem, I do not see any changes happening in the back-office. I do not see any options for making the pages searchable.
The second problem is tied with the Wagon which I use for development. I tried installing the gem locomotivecms-search-wagon, but without success.
Here is exactly what I have done in more details.
I have added the locomotive_search gem to the engine and ran bundle install without problems.
gem 'locomotivecms-search', '>= 0.3.5', require: 'locomotive/search/mongoid'
bundle install
As per instructions on the Documentation website (http://doc.locomotivecms.com/guides/search), I tried adding a gem for Wagon, however, it was not found.
gem 'locomotivecms-search-wagon', '~> 0.3.5'
bundle install
The bundler returned following output:
Fetching gem metadata from https://rubygems.org/........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Could not find gem 'locomotivecms-search-wagon (~> 0.3.5) ruby' in the gems available on this machine.
So, I proceeded. I added the search form which when submitted would send request to /?t=SEARCH_TERM
I created the indexes by running the rake db:mongoid:create_indexes
I then created a search page and made the contents of it resemble the code found at the bottom of this page: http://doc.locomotivecms.com/guides/search
When I tried to push the pages via bundle exec wagon push production -r pages
I got the following error:
creating search{"template"=>["Liquid Syntax error ('Unknown tag 'search_for'' on '')"], "raw_template"=>["Liquid Syntax error ('Unknown tag 'search_for'' on '')"]}
I assume that this is happening because I could not install the locomotivecms-search-wagon gem, however, I do not know how to proceed, so I would appreciate all help.
I had the similar problem. Try to set:
setParameter=textSearchEnabled=true
----> in mongodb.conf file mannually.
I created a custom gem called pdf2html. The gem file is pdf2html-0.1.gem
I placed this file in the vendor directory of rails 3 project.
My Gemfile entry for this gems reads as follows
gem 'pdf2html', '0.1' , :path => 'vendor'
When I run the bundle install command I get the following message regarding this gem
* pdf2html at `vendor` will not be cached.
I tried doing a bundle show on this gem it tells me that it is installed in the vendor directory.
Now when I do a rails console and try to do a require 'pdf2html' I get a "No such file to load error"/
Can someone tell me what I am doing wrong
Thanks
Paul
I thought the proper way to declare gems was to specify the full path, not the base path, as in:
gem 'pdf2html', '0.1', :path => 'vendor/pdf2html'
The reason it doesn't error out sooner is that the path vendor/ actually exists so there's no immediate problem. It's only when you try to require vendor/pdf2html.rb, which is missing, that there's an issue raised.
I pushed the gem and associated files over to github and then installed it from there using the Gemfile/ bundle install. Now its working fine. I could not figure out how to use the local gem file
My gem file looks like:
group :development, :test do
gem 'rspec-rails'
gem 'annotate-models', '1.0.4'
end
I ran 'bundle install' and it installed the annotate-models bundle.
If I type: annotate I get a command not found error.
If I type: bundle show annotate I get a 'could not find gem annotate in the current bundle.
If I type bundle show annotate-models it says it installed in:
/Library/Ruby/Gems/1.8/gems/annotate-models-1.0.4
typing:
annotate-models
doesn't work either.
I'm following along in railstutorial.org and got stuck at this point.
Edit: Better version (using Bundler to install it only for the current project)
Add gem 'annotate' to Gemfile
Run $ bundle install
Run $ bundle exec annotate
Edit2: Seems you have to explicitly specify annotate version for now, so in Gemfile put gem 'annotate', '2.4.1.beta1' (which is a prereleased beta gem that works with the latest version of activerecord as opposed to specifying the github repo directly)
Edit3: 2.5.0 final is out now, so hopefully no need to force a beta version any more, just getting the latest should work!
Old version (with installing the gem on a system level too):
If running Rails 3 the drill is:
Run $ sudo gem install annotate
Add gem 'annotate' to Gemfile
Run $ bundle install
Run $ annotate
Be happy :)
You should run the command inside your bundled environment with:
$ bundle exec annotate
Check out the man page for more details.
The most voted answer didn't fully work for me, as I was getting and additional error when follow the proposed solution:
undefined method `namespace' for main:Object (NoMethodError)
I'm including below what worked for me (I'm using Ruby 1.9.2 and Rails 3.1.3 under Ubuntu 11.10):
Install annotate
$ gem install annotate
Modify Gemfile adding the following line
gem 'annotate',
:git => 'git://github.com/jeremyolliver/annotate_models.git',
:branch => 'rake_compatibility'
Install bundle
$ bundle install
Now you can use annotate as follows:
$ bundle exec annotate
I'm new to this, but I was having this problem doing the rails tutorial, but by adding the gems bin path to the PATH env variable I was able to fix it. (Just like gertas said a few posts above)
First in the command prompt:
gem list -d annotate
and you'll get a result that says something like
: annotate-models (1.0.4)
Author: Dave Thomas
Rubyforge: http://rubyforge.org/projects/annotate-models
Homepage: h'ttp://annotate-models.rubyforge.org
Installed at: C:/ruby192/lib/ruby/gems/1.9.1
the key line is:
Installed at: C:/ruby192/lib/ruby/gems/1.9.1
So in this case add a /bin to that path, For example I used: C:\ruby192\lib\ruby\gems\1.9.1\bin is what you want to add to your PATH environment variable.
To change your PATH environment variable on Vista do the following go to: control panel >> system >> advanced system settings(link on the left). Once the box opens up,click the Advanced tab and then the Environment variables button. Then on the system variables find the PATH variable and click the Edit button. Since paths are separated by semi-colons, add
;C:\ruby192\lib\ruby\gems\1.9.1\bin
At the end of the variable value field.
It should look like
`some/path;some_other_path;C:\ruby192\lib\ruby\gems\1.9.1\bin`
when you finish
Save it, and close and reopen the command prompt. annotate and rspec started to work for me after that. Good luck.
For me the answer was this one:
http://news.railstutorial.org/model-annotation
Use
gem 'annotate', '2.4.0'
instead of
gem 'annotate-models', '1.0.4'
It looks like the gem name was changed at RubyGems.org.
I think your PATH env variable lacks path to gems bin directory.
I guess it should be: /Library/Ruby/Gems/1.8/bin
You can use it for Rails 4, add gem in your gem file gem "annotate", "~> 2.5.0" and run following command
rails g annotate_models:install
instead of
rails g annotate:install
Then run following command to add schema information after model class
bundle exec annotate -p after
or can use following for before
bundle exec annotate -p before
If bundle exec annotate doesn't work, try:
rake annotate_models