Ellen W
Ellen W

Reputation: 237

Rails g figaro:install

I know this question has already been asked in these pages, but the accepted answer repeats the basic figaro instructions, without addressing the actual error. I'm a newbie, so I'd appreciate any help . . .

I've included gem 'figaro' in my Gemfile, I've run "bundle install" from my command line. But when I enter "Rails g figaro:install" at the command line, I get the error that "Could not find generator Figaro:install."

I've searched this all over the web, and all I can find are the basic instructions. Can anyone tell me why Rails can't find the generator?

Thank you.

Upvotes: 2

Views: 1265

Answers (4)

Eliot Sykes
Eliot Sykes

Reputation: 10073

At time of writing, it looks like the Figaro stable version has changed recently from 0.7.0 to 1.0.0.

The rails g figaro:install command is from 0.7.0, and my guess is that 1.0.0 is installed.

To check the version used:

cd path/to/a/rails/project/directory
bundle exec gem query '\Afigaro\z'

Assuming figaro 1.0.0 is being used by the app, then the figaro commands you'll be using from now on are these (these replace the commands used by Figaro 0.7.0):

figaro install # Installs figaro into your app
figaro heroku:set -e production # Copies env config from application.yml to Heroku

Upvotes: 6

Sandeep Kapil
Sandeep Kapil

Reputation: 992

For heroku just use:

bundle exec figaro heroku:set -e production

Upvotes: 0

Kannan S
Kannan S

Reputation: 2489

I got the same error in my development, This is because of figaro updated version 1.1 +. Please read the Getting Started in Figaro Gem installation part.

give the following command after bundle install

bundle exec figaro install

It will generate the following files

  create  config/application.yml
  append  .gitignore

Upvotes: 1

AnkitG
AnkitG

Reputation: 6568

Figaro gem Readme tells that to install use

$ figaro install

You are using figaro:install

Upvotes: 2

Related Questions