small medium large xlarge

Generic-user-small
19 Mar 2008, 03:02
Charles Harvey (5 posts)

When going through the tutorial I get

Loading development environment (Rails 2.0.2) » SecretPatient.create(:name => ‘John Doe’, :address => ‘Somewhere Secret’, :ssn => ‘012-345-6789’)
Errno::ENOENT: No such file or directory - /Users/jane/Development/actsassecure/config/crypto.yml

then I created a blank file called config/crypto.yml and try again and I get

    from (irb):1>> SecretPatient.create(:name => 'John Doe', :address => 'Somewhere Secret', :ssn => '012-345-6789')   NoMethodError: undefined method `[]' for false:FalseClass
    from /Users/jane/Development/actsassecure/lib/master_crypto_provider.rb:13

I have the latest acts_as_secure rel_0_0_3: date: 2007-06-26

and ezcrypto (0.7)

Best Regards-

Charles

See the pastie for a nice view

http://pastie.caboo.se/167623

jane-harveys-computer:~/Development/actsassecure jane$ script/console Loading development environment (Rails 2.0.2) » SecretPatient.create(:name => ‘John Doe’, :address => ‘Somewhere Secret’, :ssn => ‘012-345-6789’)
Errno::ENOENT: No such file or directory - /Users/jane/Development/actsassecure/config/crypto.yml from /usr/local/lib/ruby/1.8/yaml.rb:143:in initialize' from /usr/local/lib/ruby/1.8/yaml.rb:143:in open’ from /usr/local/lib/ruby/1.8/yaml.rb:143:in load_file' from /Users/jane/Development/actsassecure/lib/master_crypto_provider.rb:13 from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:203:in load_without_new_constant_marking’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:203:in load_file' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in new_constants_in’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:202:in load_file' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:94:in require_or_load’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:248:in load_missing_constant' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in const_missing’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:465:in const_missing' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:260:in load_missing_constant’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:469:in const_missing' from /Users/jane/Development/actsassecure/app/models/secret_patient.rb:10 from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:203:in load_without_new_constant_marking’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:203:in load_file' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in new_constants_in’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:202:in load_file' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:94:in require_or_load’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:248:in load_missing_constant' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in const_missing’ from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:465:in `const_missing’

    ### So I created a blank config/crypto.yml file and tried again
    
    from (irb):1>> SecretPatient.create(:name => 'John Doe', :address => 'Somewhere Secret', :ssn => '012-345-6789')   NoMethodError: undefined method `[]' for false:FalseClass
    from /Users/jane/Development/actsassecure/lib/master_crypto_provider.rb:13
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:203:in `load_without_new_constant_marking'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:203:in `load_file'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:202:in `load_file'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:94:in `require_or_load'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:248:in `load_missing_constant'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in `const_missing'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:465:in `const_missing'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:471:in `send'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:471:in `const_missing'
    from /Users/jane/Development/actsassecure/app/models/secret_patient.rb:10
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:203:in `load_without_new_constant_marking'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:203:in `load_file'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:202:in `load_file'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:94:in `require_or_load'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:248:in `load_missing_constant'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in `const_missing'
    from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:465:in `const_missing'
    from (irb):2>>
Mike-120_pragsmall
21 Mar 2008, 13:18
Mike Clark (51 posts)

Charles -

Does your crypto.yml file look like this?

development:
  master_key: YOUR_SECRET_MASTER_KEY
  salt: YOUR_SALT

That’s the format the MasterCryptoProvider class in the book assumes. If your file is in that format, then I’d need to see your master_crypo_provider.rb file to see what’s on line 13.

Mike

Generic-user-small
22 Mar 2008, 04:59
Charles Harvey (5 posts)

Hi Mike-

Thanks. I could not find the details of the crypto.yml file in the recipe. Your update here is a great help.

Best Regards-

Charles

Mike-120_pragsmall
27 Mar 2008, 17:03
Mike Clark (51 posts)

I’ve added crypto.yml to the recipe to avoid future confusion.

Thanks!

Mike

You must be logged in to comment