Sinatra with Figaro Gem
You should declare yuor variables in application.yml as explained at Figaro github README https://github.com/laserlemon/figaro (in YAML syntax):
pusher_app_id: "2954"
pusher_key: "7381a978f7dd7f9a1117"
pusher_secret: "abdc3b896a0ffb85d373"
test:
pusher_app_id: "5112"
pusher_key: "ad69caf9a44dcac1fb28"
pusher_secret: "83ca7aa160fedaf3b350"
...
You will be able to access the declared variables as follows:
ENV["stripe_api_key"] # => "sk_live_dSqzdUq80sw9GWmuoI0qJ9rL"
ENV.key?("stripe_api_key") # => true
ENV["google_analytics_key"] # => nil
ENV.key?("google_analytics_key") # => false
Why heroku detects my sinatra app as rails and fails?
You answered it yourself:
figaro depend on Rails (see the gemspec: https://github.com/laserlemon/figaro/blob/master/figaro.gemspec). Heroku detect rails application by looking if their Gemfile.lock contains the Railties gem, which is a dependency of rails.
So: yourapp -> figaro -> rails -> railties.
Hence the identification of your gem as a Rails App. Why are you using Figaro if not to help configure a Rails application anyway?
How to get application.yaml file after cloning repository
The file config/application.yml
is not included in the repository for security
The README say:
... This creates a commented config/application.yml file and adds it to your .gitignore ...
The idea is to not have passwords, api key and other in the repository.
You have to write the configuration.yml
file in each computer you have your sistem.
Related Topics
Override Vagrant Configuration Settings Locally (Per-Dev)
Why Would We Put a Module Inside a Class in Ruby
How to Add 'Each' Method to Ruby Object (Or Should I Extend Array)
No Such File to Load -- Bundler/Setup in Rails 3.2 with Passenger
How to Use 'Debugger' and 'Pry' When Developing a Gem? (Ruby)
Enter & Ioerror: Byte Oriented Read for Character Buffered Io
Passing Hashes Instead of Method Parameters
Ide Sublime2 How to Find Method Definition
Why Must I Explicitly Call Self on Accessor When Using the Array Union Operator |= in Ruby
Rails 4 Use Application Helpers Inside Initializers
Generate Array of All Letters and Digits
Create a Ruby Method That Accepts a Hash of Parameters
New to Ruby and Am Having Trouble with Load_Path