Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

require 'icalendar' causes error

Posted on 2013-01-07
1
Medium Priority
?
501 Views
Last Modified: 2013-01-11
Hello,

I'm relatively new to Ruby-on-Rails.

I need to use an Icalendar event in my web app.

First, I installed the icalendar gem like so:

gem install icalendar

I then run the gem list command, and it indicates the gem is installed.

However, I can't actually use the gem anywhere.  if I do something like

event = Icalendar::Event.new

I get the error that Icalendar is an unintialized constant.

If I try to include icalendar within a class like so...

require 'icalendar'

I get the error

MissingSourceFile:  no such file to load -- icalendar

any suggestions?

Thanks in advance,
Tim
0
Comment
Question by:tmitch68
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 24

Accepted Solution

by:
fridom earned 2000 total points
ID: 38766051
I tried to reproduce your problem but failes. I did the following:
rvm install 1.9.3 (to install the actual MRI)
then I run
sudo gem install icalendar
after that I started irb
requrired 'icalendar'
and types in your command:
Here's the output:
sudo gem install icalendar
[sudo] password for frido: 
Fetching: icalendar-1.2.1.gem (100%)
PostInstall.txt
Successfully installed icalendar-1.2.1
1 gem installed
Installing ri documentation for icalendar-1.2.1...
Installing RDoc documentation for icalendar-1.2.1...
~% irb
1.9.3p125 :001 > require 'icalendar'
 => true 

1.9.3p125 :003 > event = Icalendar::Event.new
 => #<Icalendar::Event:0x00000000eabd48 @name="VEVENT", @components={}, @properties={"sequence"=>0, "dtstamp"=>#<DateTime: 2013-01-11T07:35:21+01:00 ((2456304j,23721s,614212958n),+3600s,2299161j)>, "uid"=>"2013-01-11T07:35:21+01:00_386670668@fxen"}> 
1.9.3p125 :004 > 

Open in new window



I would assume that something is wrong with either your ruby installation
or the gem installation.

Maybe you should use the rvm collection?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
In Ruby, Call or invoke a API DLL library is easily via Win32API class, win32-api gem or other gems. For general DLL API call, there are quite a few references, some good tips list below: http://www.rubytips.org/2008/05/13/accessing-windows-api-fro…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question