Error for uuid

hi all,
i am getting following error when running my code .Is anyone who knows
who to install uuid gem ? or what are gems required before install uuid
gem
?

“no such file to load – uuid”

Ruby On Rails version using :-
gem :1.7.2
ruby:1.8.7
rails:2.3.4

Thanks and Regards
Sachin S. Kewale

( . ) Always.( . ) Keep (. ). Smiling!!
`…

On 8 December 2011 10:51, sachin kewale [email protected] wrote:

hi all,
i am getting following error when running my code .Is anyone who knows who
to install uuid gem ? or what are gems required before install uuid gem ?

“no such file to load – uuid”

Are you trying to use uuid values? If not then there should be no
need for anything. Post the full error and trace if you do not think
you are using uuid values. First though search your source code for
‘uuid’.

If you are using uuid values show us the code that uses it and tell us
which version of rails you are using.

Colin

On 8 December 2011 11:25, sachin kewale [email protected] wrote:

  new_temp_user.guid       = UUID.new

There is no native support for uuid in rails as far as I know. I
believe there are gems available to provide this, though I have not
used them, google should help you find them. If you picked up this
code from an example or tutorial have a look at it and see if it makes
a recommendation.

Do you really need uuids though?

By the way, if you need to use rails 2.3 you should at least use the
latest 2.3.x (11 I think) as there were some security fixes. If you
are writing a new app then best to use 3.1

Colin

On Thu, Dec 8, 2011 at 12:25 PM, sachin kewale
[email protected]wrote:

On Rails 3 you could use:

in Gemfile:

gem ‘uuidtools’

in the code:

UUIDTools::UUID.random_create.to_s

I am not sure how well this would work in Rails 2.3.x

HTH,

Peter

If you don’t really need a real uuid, you could just gen something
similar yourself using ActiveSupport::SecureRandom.hex:


def gen_uuid_ish
s = ActiveSupport::SecureRandom.hex(16)
[ s[0…7], s[8…11], s[12…15], s[16…19], s[20…-1] ].join(’-’)
end

which will produce strings like “3ec1a6a0-017a-8fb4-0c26-56858ddc3886”

Jeff

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs