adamthedeveloper / wepay-rails

Collect payments from wepay in your rails application.
MIT License
32 stars 24 forks source link

Installation not working- wepay.yml is missing #6

Closed tomerlondon closed 12 years ago

tomerlondon commented 12 years ago

When I run 'script/rails g wepay_rails:install' it says that wepay.yml doesnt exist.

Any suggestions?

adamthedeveloper commented 12 years ago

Yeah - there should be a wepay.yml.example file in your config folder. Copy it to wepay.yml and add your configuration directives to it. Let me know if that file exists for you. It should have been created when you installed wepay-rails.

adamthedeveloper commented 12 years ago

Sorry - I was working on another issue at work and didn't read your message carefully enough. I haven't come across this bug before - I suggest you create a blank wepay.yml file in your config folder and try running this again. Once it works, then copy the wepay.yml.example file to wepay.yml and configure it. Let me know if that works for you - I'll look into the issue and update the gem tonight with a fix.

tomerlondon commented 12 years ago

Thanks, I actually tried it and I get another error: "undefined method '[]' for false:FalseClass (NoMethodError)" from wepay-rails.rb:22.

Any suggestions?

adamthedeveloper commented 12 years ago

Yeah - looks like we have a cart before the horse bug here. Try manually copying wepay-rails/lib/generators/wepay_rails/install/templates/wepay.yml To your config directory, change the directives for your app and run the install again.

adamthedeveloper commented 12 years ago

The problem is probably in the Engine initialization. I will change the code to make sure the wepay.yml file exists before trying to build a config object from it. I can't get to it until this evening though. Thanks for sharing the bug with me - let me know how it goes.

tomerlondon commented 12 years ago

Thanks. I tried it and I den a 'method_missing' error for method 'symbolize_keys' for nil:nilClass (NoMethodError). Please tell me if you think there is a quick fix

adamthedeveloper commented 12 years ago

The line it's failing for you on is:

settings = YAML.load_file(yml)[Rails.env].symbolize_keys

What does Rails.env return for you? Is there a matching environment directive in your wepay.yml?

adamthedeveloper commented 12 years ago

I added a File.exists? around the configuration initialization checking for the existence of wepay.yml and ignoring the setting up of the configuration when we are trying to install wepay-rails.

tomerlondon commented 12 years ago

Thanks for that. I can't seem to get the latest version 2.2.3 from rubygems.org using bundle install.

adamthedeveloper commented 12 years ago

Can you show me the line in your Gemfile where you are specifying wepay-rails?

You can also try bundle update.

The new version is definitely up on rubygems: http://rubygems.org/gems/wepay-rails

Let me know how I can help.

Adam

On Tue, Dec 13, 2011 at 11:22 AM, tomerlondon reply@reply.github.com wrote:

Thanks for that. I can't seem to get the latest version 2.2.3 from rubygems.org using bundle install.


Reply to this email directly or view it on GitHub: https://github.com/adamthedeveloper/wepay-rails/issues/6#issuecomment-3127973

A.R. Medeiros

adamthedeveloper commented 12 years ago

Shall I reopen this ticket? Did you get wepay-rails working in your app? Thanks.

adamthedeveloper commented 12 years ago

I actually fixed the wepay.yml.example file to also have the directives for the development and test environments and not just production. I think this is what the problem was. Committed the fix.