В чем разница между добавлением RAILS_ENV
до или после рейк-задачи? Ниже приведены образцы из моей промежуточной среды:Разница между добавлением RAILS_ENV до или после задачи рейка
Добавление
RAILS_ENV
после граблирования задачи.Это вызвало ошибку, и причина этого заключается в том, что среда
development
по умолчанию и не принимаетdevutility
в качестве среды.$bundle exec rake -T RAILS_ENV=devutility $rake aborted! $cannot load such file -- rack/bug
Добавление
RAILS_ENV
Перед передней задачиЭто работает и перечисляет все задачи грабли доступны.
$RAILS_ENV=devutility bundle exec rake -T rake about # List versions of all Rails frameworks and the environment rake assets:clean # Remove compiled assets rake assets:precompile # Compile all the assets named in config.assets.precompile rake bourbon:install[sass_path] # Move files to the Rails assets directory rake ci # Continuous Integration build (simplecov-rcov and deploy) rake cucumber # Alias for cucumber:ok rake cucumber:all # Run all features rake cucumber:ok # Run features that should pass rake cucumber:rerun # Record failing features and run only them if any exist rake cucumber:wip # Run features that are being worked on rake db:create # Create the database from DATABASE_URL or config/database.yml for the current Rails.env (use db:create:all to create all dbs in the config) rake db:data:dump .................... ..............
хорошо, но знаете ли вы, почему он ведет себя странным образом, когда находится в конце задачи рейка? – AnkitG
Да, потому что вы запускаете задачу рейка и * затем * устанавливаете RAILS_ENV, чтобы она не была установлена во время запуска rake. – jordelver
@AnkitG это вам помогло? – jordelver