Easysearch:autosuggest ReferenceError: Template is not defined - templates

I left to guess of what to do as after installing all the dependencies and easysearch:autosuggest in an application the app began to throw error. I'm on Meteor version-1.2.1. I'd thought it's lodash that's causingthe problem but after installing lodash the problem persists.
=> Meteor server restarted
Changes to your project's package version selections:
easysearch:autosuggest added, version 2.0.10
W20170706-14:37:18.456(1)? (STDERR)
W20170706-14:37:18.462(1)? (STDERR) C:\Users\ken4ward\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\fibers\future.js:245
W20170706-14:37:18.462(1)? (STDERR) throw(ex);
W20170706-14:37:18.462(1)? (STDERR) ^
W20170706-14:37:18.462(1)? (STDERR) ReferenceError: Template is not defined
W20170706-14:37:18.465(1)? (STDERR) at Package (lib/autosuggest.js:1:1)
W20170706-14:37:18.465(1)? (STDERR) at C:\Programs\contract\crowducate-platform\.meteor\local\build\programs\server\packages\easysearch_autosuggest.js:101:4
W20170706-14:37:18.465(1)? (STDERR) at C:\Programs\contract\crowducate-platform\.meteor\local\build\programs\server\packages\easysearch_autosuggest.js:108:3
W20170706-14:37:18.466(1)? (STDERR) at C:\Programs\contract\crowducate-platform\.meteor\local\build\programs\server\boot.js:242:10
W20170706-14:37:18.472(1)? (STDERR) at Array.forEach (native)
W20170706-14:37:18.47 Selecting package versions -h (C:\Users\ken4ward\AppData\Local\.meteor\packages\m
eteor-tool\1.1.10\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\underscore\underscore.js:79:1 TDERR) at C:\Programs\contract\crowducate-platform\.meteor\local\build\programs\server\
boot.js:137:5 Selecting package versions /
=> Exited with code: 8
meteor packages
# Meteor packages used by this project, one per line.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.
less
accounts-password
useraccounts:bootstrap
alanning:roles
zimme:iron-router-active
cmather:handlebars-server#0.2.0
dburles:collection-helpers
reywood:publish-composite
mrt:moment
mrt:underscore-string-latest
matb33:collection-hooks
dburles:factory
anti:fake
cunneen:mailgun
iron:router#1.0.0
yasinuslu:blaze-meta
insecure
jeremy:selectize
reactive-var
rubaxa:sortable
cfs:filesystem
cfs:standard-packages
gadicohen:messageformat
browser-policy
aldeed:autoform
aldeed:collection2
babrahams:editable-text-wysiwyg-bootstrap-3
useraccounts:iron-routing
juliancwirko:s-alert
standard-minifiers
meteor-base
mobile-experience
mongo
blaze-html-templates
session
jquery
tracker
logging
reload
random
ejson
spacebars
check
themeteorchef:bert
ctjp:meteor-intl-tel-input
u2622:persistent-session
meteor version
accounts-base#1.2.2
accounts-password#1.1.4
alanning:roles#1.2.14
aldeed:autoform#5.7.1
aldeed:collection2#2.5.0
aldeed:simple-schema#1.4.0
amplify#1.0.0
anti:fake#0.4.1
autoupdate#1.2.4
babel-compiler#5.8.24_1
babel-runtime#0.1.4
babrahams:editable-text#0.8.6
babrahams:editable-text-wysiwyg#0.5.6
babrahams:editable-text-wysiwyg-bootstrap-3#0.5.6
base64#1.0.4
binary-heap#1.0.4
blaze#2.1.3
blaze-html-templates#1.0.1
blaze-tools#1.0.4
boilerplate-generator#1.0.4
browser-policy#1.0.5
browser-policy-common#1.0.4
browser-policy-content#1.0.6
browser-policy-framing#1.0.6
caching-compiler#1.0.0
caching-html-compiler#1.0.2
callback-hook#1.0.4
cfs:access-point#0.1.49
cfs:base-package#0.0.30
cfs:collection#0.5.5
cfs:collection-filters#0.2.4
cfs:data-man#0.0.6
cfs:file#0.1.17
cfs:filesystem#0.1.2
cfs:http-methods#0.0.30
cfs:http-publish#0.0.13
cfs:power-queue#0.9.11
cfs:reactive-list#0.0.9
cfs:reactive-property#0.0.4
cfs:standard-packages#0.5.9
cfs:storage-adapter#0.2.3
cfs:tempstore#0.1.5
cfs:upload-http#0.0.20
cfs:worker#0.1.4
check#1.1.0
cmather:handlebars-server#0.2.0
coffeescript#1.0.11
ctjp:meteor-intl-tel-input#3.7.1_2
cunneen:mailgun#0.9.1
dburles:collection-helpers#1.0.4
dburles:factory#0.3.10
dburles:mongo-collection-instances#0.3.4
ddp#1.2.2
ddp-client#1.2.1
ddp-common#1.2.2
ddp-rate-limiter#1.0.0
ddp-server#1.2.2
deps#1.0.9
diff-sequence#1.0.1
djedi:sanitize-html#1.11.1
ecmascript#0.1.6
ecmascript-runtime#0.2.6
ejson#1.0.7
email#1.0.8
fastclick#1.0.7
fortawesome:fontawesome#4.4.0_1
fourseven:scss#3.3.3_3
gadicohen:headers#0.0.31
gadicohen:messageformat#0.0.52
geojson-utils#1.0.4
handlebars#1.0.4
hot-code-push#1.0.0
html-tools#1.0.5
htmljs#1.0.5
http#1.1.1
id-map#1.0.4
insecure#1.0.4
iron:controller#1.0.12
iron:core#1.0.11
iron:dynamic-template#1.0.12
iron:layout#1.0.12
iron:location#1.0.11
iron:middleware-stack#1.1.0
iron:router#1.0.12
iron:url#1.0.11
jeremy:selectize#0.12.1_4
jquery#1.11.4
juliancwirko:s-alert#3.1.2
lai:collection-extensions#0.1.4
launch-screen#1.0.4
less#2.5.1
livedata#1.0.15
localstorage#1.0.5
logging#1.0.8
matb33:collection-hooks#0.8.1
mdg:validation-error#0.1.0
meteor#1.1.10
meteor-base#1.0.1
meteorhacks:inject-initial#1.0.3
minifiers#1.1.7
minimongo#1.0.10
mobile-experience#1.0.1
mobile-status-bar#1.0.6
momentjs:moment#2.10.6
mongo#1.1.3
mongo-id#1.0.1
mongo-livedata#1.0.9
mrt:moment#2.8.1
mrt:underscore-string-latest#2.3.3
npm-bcrypt#0.7.8_2
npm-mongo#1.4.39_1
observe-sequence#1.0.7
ordered-dict#1.0.4
promise#0.5.1
raix:eventemitter#0.1.3
random#1.0.5
rate-limit#1.0.0
reactive-dict#1.1.3
reactive-var#1.0.6
reload#1.1.4
retry#1.0.4
reywood:publish-composite#1.4.2
routepolicy#1.0.6
rubaxa:sortable#1.3.0
service-configuration#1.0.5
session#1.1.1
sha#1.0.4
softwarerero:accounts-t9n#1.1.6
spacebars#1.0.7
spacebars-compiler#1.0.7
srp#1.0.4
standard-minifiers#1.0.2
templating#1.1.5
templating-tools#1.0.0
themeteorchef:bert#2.1.0
tracker#1.0.9
u2622:persistent-session#0.4.4
ui#1.0.8
underscore#1.0.4
underscorestring:underscore.string#3.2.2
url#1.0.5
useraccounts:bootstrap#1.12.4
useraccounts:core#1.12.4
useraccounts:iron-routing#1.12.4
webapp#1.2.3
webapp-hashing#1.0.5
yasinuslu:blaze-meta#0.3.3
zimme:iron-router-active#1.0.4
These are the contents of the meteor version and packages.

Related

Deploying JHipster generated app to AWS via ECS using AWS Fargate errors

Deploying generated app with JHipster(version: 5.8.2) to AWS using aws-containers sub-generator gives ERROR! Cannot find module 'aws-sdk'
$ jhipster import-jdl blog.jh.
Content of blog.jh:
application {
config {
baseName blog,
applicationType monolith,
packageName org.jhipster.blog,
authenticationType jwt,
prodDatabaseType mysql,
cacheProvider no,
enableHibernateCache false,
buildTool maven,
clientFramework angularX,
useSass false,
testFrameworks [protractor]
}
entities *
}
entity Blog {
name String required minlength(3),
handle String required minlength(2)
}
entity Entry {
title String required,
content TextBlob required,
date Instant required
}
entity Tag {
name String required minlength(2)
}
relationship ManyToOne {
Blog{user(login)} to User,
Entry{blog(name)} to Blog
}
relationship ManyToMany {
Entry{tag(name)} to Tag{entry}
}
paginate Entry, Tag with infinite-scroll
$ jhipster aws-containers
INFO! Using JHipster version installed locally in current project's node_modules
INFO! Executing jhipster:aws-containers
INFO! Options: from-cli: true
ERROR! Cannot find module 'aws-sdk'
{ Error: Cannot find module 'aws-sdk'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/generator-jhipster/generators/aws-containers/lib/ssm.js:19:13)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3) code: 'MODULE_NOT_FOUND' }
$ npm install aws-sdk gave
ERROR! Cannot find module 'ora'
$ npm install ora
And it came to:
$ jhipster aws-containers
INFO! Using JHipster version installed locally in current project's node_modules
INFO! Executing jhipster:aws-containers
INFO! Options: from-cli: true
This AWS generator will help you deploy your JHipster app as a Docker container on AWS.
✔ Docker is installed
Installing AWS dependencies
✔ AWS credentials using profile default.
events.js:174
throw er; // Unhandled 'error' event
^
TypeError: ora is not a function
at spinner (/home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/generator-jhipster/generators/aws-containers/aws-client.js:120:21)
at Object.listRegions (/home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/generator-jhipster/generators/aws-containers/aws-client.js:142:12)
at module.exports.fetchRegion (/home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/generator-jhipster/generators/aws-containers/index.js:159:22)
at Object.<anonymous> (/home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/yeoman-generator/lib/index.js:418:27)
at /home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/run-async/index.js:25:25
at new Promise (<anonymous>)
at /home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/run-async/index.js:24:19
at self.env.runLoop.add.completed (/home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/yeoman-generator/lib/index.js:419:13)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
Emitted 'error' event at:
at Immediate.setImmediate (/home/stane/Work/Lab/JHipster/blog.aws-containers/node_modules/yeoman-generator/lib/index.js:427:22)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
at process.topLevelDomainCallback (domain.js:120:23)

Codeception Allure Module error: [Doctrine\Common\Annotations\AnnotationException] The annotation "#env" ... was never imported

Our current project uses Codeception with the Codeception Allure addon and we are now seeing the following error when we run codecept run acceptance --env chrome --group banana --debug. This error began appearing a few days ago and we are unsure how to correct it. Has anyone ran into this error recently? I have found a number of old posts regarding similar issues but they have all been fixed by the project owners.
[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] The annotation "#env" in method
LogIntoAdminCest::logIntoAdmin() was never imported. Did you maybe
forget to add a "use" statement for this annotation?
Exception trace:
() at /vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:54
Doctrine\Common\Annotations\AnnotationException::semanticalError() at /vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:727
Doctrine\Common\Annotations\DocParser->Annotation() at /vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:663
Doctrine\Common\Annotations\DocParser->Annotations() at /vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:354
Doctrine\Common\Annotations\DocParser->parse() at /vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php:284
Doctrine\Common\Annotations\AnnotationReader->getMethodAnnotations() at /vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php:71
Doctrine\Common\Annotations\IndexedReader->getMethodAnnotations() at /vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/AnnotationProvider.php:43
Yandex\Allure\Adapter\Annotation\AnnotationProvider::getMethodAnnotations() at /vendor/allure-framework/allure-codeception/src/Yandex/Allure/Adapter/AllureAdapter.php:250
Yandex\Allure\Adapter\AllureAdapter->testStart() at n/a:n/a
call_user_func() at /vendor/symfony/event-dispatcher/EventDispatcher.php:212
Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() at /vendor/symfony/event-dispatcher/EventDispatcher.php:44
Symfony\Component\EventDispatcher\EventDispatcher->dispatch() at /vendor/codeception/codeception/src/Codeception/PHPUnit/Listener.php:90
Codeception\PHPUnit\Listener->startTest() at /vendor/phpunit/phpunit/src/Framework/TestResult.php:386
PHPUnit_Framework_TestResult->startTest() at /vendor/codeception/codeception/src/Codeception/Test/Test.php:74
Codeception\Test\Test->run() at /vendor/phpunit/phpunit/src/Framework/TestSuite.php:722
PHPUnit_Framework_TestSuite->run() at /vendor/codeception/codeception/src/Codeception/PHPUnit/Runner.php:106
Codeception\PHPUnit\Runner->doEnhancedRun() at /vendor/codeception/codeception/src/Codeception/SuiteManager.php:157
Codeception\SuiteManager->run() at /vendor/codeception/codeception/src/Codeception/Codecept.php:184
Codeception\Codecept->runSuite() at /vendor/codeception/codeception/src/Codeception/Codecept.php:175
Codeception\Codecept->run() at /vendor/codeception/codeception/src/Codeception/Command/Run.php:376
Codeception\Command\Run->runSuites() at /vendor/codeception/codeception/src/Codeception/Command/Run.php:303
Codeception\Command\Run->execute() at /vendor/symfony/console/Command/Command.php:264
Symfony\Component\Console\Command\Command->run() at /vendor/symfony/console/Application.php:874
Symfony\Component\Console\Application->doRunCommand() at /vendor/symfony/console/Application.php:228
Symfony\Component\Console\Application->doRun() at /vendor/symfony/console/Application.php:130
Symfony\Component\Console\Application->run() at /vendor/codeception/codeception/src/Codeception/Application.php:103
Codeception\Application->run() at /vendor/codeception/codeception/codecept:36
run [-o|--override OVERRIDE] [-e|--ext EXT] [--report] [--html [HTML]] [--xml [XML]] [--tap [TAP]] [--json [JSON]] [--colors] [--no-colors] [--silent] [--steps] [-d|--debug] [--coverage [COVERAGE]] [--coverage-html [COVERAGE-HTML]] [--coverage-xml [COVERAGE-XML]] [--coverage-text [COVERAGE-TEXT]] [--coverage-crap4j [COVERAGE-CRAP4J]] [--no-exit] [-g|--group GROUP] [-s|--skip SKIP] [-x|--skip-group SKIP-GROUP] [--env ENV] [-f|--fail-fast] [--no-rebuild] [--] [<suite>] [<test>]

Rails 4: How to add ENVIRONMENT VARIABLES on Ubuntu 14.04 using RVM?

Right now I'm trying to deploy my Ruby on Rails app to a Virtual Machine on Windows Azure running Ubuntu but I can fix de set environment variables error as below describe.
I have done added variables to my .bashrc and now in /etc/environment but the error is the same:
App 1227 stderr: [ 2015-10-06 04:10:57.3814 1352/0x9020d38(Worker 1) utils.rb:86 ]: *** Exception RuntimeError in Rack application object (Missing `secret_to$
App 1227 stderr: from /home/deploy/apps/matching_people/shared/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/application.rb:534:in `validate_secret_$
App 1227 stderr: from /home/deploy/apps/matching_people/shared/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/application.rb:246:in `env_config'
App 1227 stderr: from /home/deploy/apps/matching_people/shared/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/engine.rb:514:in `call'
App 1227 stderr: from /home/deploy/apps/matching_people/shared/bundle/ruby/2.2.0/gems/railties-4.2.4/lib/rails/application.rb:165:in `call'
App 1227 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:94:in `process_request'
App 1227 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:151:in `accept_and_process_next_request'
App 1227 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:112:in `main_loop'
App 1227 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:415:in `block (3 levels) in start_threads'
App 1227 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:112:in `block in create_thread_and_abort_on_exception'
[ 2015-10-06 04:10:57.3819 988/b5efeb40 age/Cor/Req/Utils.cpp:95 ]: [Client 1-1] Sending 502 response: application did not send a complete response
This is my sudo nano /etc/environment file:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
export SECRET_KEY_BASE=2da0d3f0bfd7b9b05110bfad512f42df2d2bb2ef715c4e831caba96a9c0b2141fbfa718dff2f5daf916cd70a70afd1f24df49884c561fbbaf364b36652b2c7d1
ruby -e 'p ENV["SECRET_KEY_BASE"]'
export MATCH_PEOPLE_DATABASE_PASSWORD=2015deployer
ruby -e 'p ENV["MATCH_PEOPLE_DATABASE_PASSWORD"]'
And when I run echo $SECRET_KEY_BASE or echo $MATCH_PEOPLE_DATABASE_PASSWORD I got the exact data.
deploy#vmw-ubuserver:~$ echo $SECRET_KEY_BASE
2da0d3f0bfd7b9b05110bfad512f42df2d2bb2ef715c4e831caba96a9c0b2141fbfa718dff2f5daf916cd70a70afd1f24df49884c561fbbaf364b36652b2c7d1
deploy#vmw-ubuserver:~$ echo $MATCH_PEOPLE_DATABASE_PASSWORD
2015deployer
But I still getting the same error in production, I'm using RVM, Capistrano, Passenger and NGINX on Ubuntu 14.04.
My database.yml :
production:
adapter: mysql2
encoding: utf8
pool: 5
host: localhost
database: matchpeople_production
username: deployer
password: <%= ENV['MATCH_PEOPLE_DATABASE_PASSWORD'] %>
My secrets.yml :
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
secret_token: <%= ENV["SECRET_KEY_BASE"] %>
Any kind of help?
Looking and looking for the correct answer I have been trying too many options but I didn't make it works fine.
So, suddenly I found I solution while I was testing some configurations found on google.
It is simple, just:
Add the next lines:
export SECRET_KEY_BASE=3aa7e349bh345h245hi23452345h234ih52i3u45h$
export MATCH_PEOPLE_DATABASE_PASSWORD=your_pass_here
# Uncomment these lines and restart the server to validate if the variables are read correctly
#ruby -e 'p ENV["SECRET_KEY_BASE"]'
#ruby -e 'p ENV["MATCH_PEOPLE_DATABASE_PASSWORD"]'
At the end of the files below:
sudo nano ~/.bash_profile
sudo nano /etc/environment
If you want you can uncomment the last two lines in ~/.bash_profile and restart your server and when you login to it again, you will see the value of the ENVIRONMENT VARIABLES before your promt as in the picture below.
I recommend you to keep those lines commented do it just for validate and then comment them again.
If you have any question, please leave a comment!
Hope it could be useful.
From my experience, there is no secret_token needed in secrets.yml for Ruby RVM.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
I think to solve the problem, remove the second line from your production: section
In case you need to add environment variables to RVM, edit
# /etc/profile.d/appspecific.sh
add something like
export GEM_PATH=/usr/local/rvm/gems/ruby-1.9.3-p551:/usr/local/rvm/gems/ruby-1.9.3-p551#global
export GEM_HOME=/usr/local/rvm/gems/ruby-1.9.3-p551
Good luck!

Rails 4 I18n - missing translation after adding new locale file

Currently I have some locales subdirectories , which are correctly set in the configuration
config/application.rb
config.i18n.load_path += Dir["#{Rails.root.to_s}/config/locales/**/*.{rb,yml}"]
I have already 2 locales files , and I can get easily the translations :
config/locales/admin/dashboard.en.yml
en:
dashboard:
title: Dashboard
config/locales/admin/dashboard.fr.yml
fr:
dashboard:
title: Tableau de bord
irb(main):014:0> I18n.locale = :en
=> :en
irb(main):015:0> I18n.t("dashboard.title")
=> "Dashboard"
irb(main):016:0> I18n.locale = :fr
=> :fr
irb(main):017:0> I18n.t("dashboard.title")
=> "Tableau de bord"
Now I added 2 other locales files ( quite similar to previous ones...) into the SAME subdirectory 'locales/admin'
# =============
config/locales/admin/sheet.en.yml
en:
sheet:
title: Sheet
config/locales/admin/sheet.fr.yml
fr:
sheet:
title: Table
I RESTARTED the server ... and tried wo success to get the new added translations
irb(main):010:0> I18n.locale = :en
=> :en
irb(main):011:0> I18n.t("sheet.title")
=> "translation missing: en.sheet.title"
irb(main):012:0> I18n.locale = :fr
=> :fr
irb(main):013:0> I18n.t("sheet.title")
=> "translation missing: fr.sheet.title"
translations missing in BOTH languages? so I guess something is wrong in the subdirectories definition in the application.rb config file, as I checked the Rails.application.config.i18n.load_path ,a dn the newly added files ARE NOT in the path ..
"..../config/locales/admin/dashboard.en.yml",
"..../config/locales/admin/dashboard.fr.yml",
but not
"..../config/locales/admin/sheet.en.yml",
"..../config/locales/admin/sheet.fr.yml",
thanks for suggestions
It seems this issue has been already detected and it's related to the 'spring' process..
# https://github.com/rails/spring/issues/408
# rafaelfranca May 28
I think you got this error because you added the locale file after you
started the spring process for your environment, so when you add the
file it is not loaded inside the spring process. When you change the
application.rb the spring process is reloaded and your locale is now
working.
I changed one line ( added one blank line ...) in the application.rb than I restarted the server , and the new translations are found
rafael stated the rails console should restart the spring
Any rails command starts springs. rails console, rails generate,
rails server. You can stop the spring process with spring stop.
so, after ADDING a new locale file, better stopping spring before restarting the server
spring stop
rails server ( or rails console )
Change application.rb => Restart the Rails server
I would like to add that any time you make any change to application.rb you must restart the server for the change to take effect, not just the i18n component.

Rails 4.2 console issues - using RAILS_ENV=development

trying to run
$ rails c RAILS_ENV=development
1 warning and 1 error are raised which I do not understand
# warning :
config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:
* development - set it to false
* test - set it to false (unless you use a tool that preloads your test environment)
* production - set it to true
# error
/config/initializers/devise.rb:13:in `+': no implicit conversion of nil into String (TypeError)
However , the config.eager_load is set to false in the development environment
config/environment/development.rb
Rails.application.configure do
config.cache_classes = false
config.eager_load = false
…/…
And looking at the config/initializers/devise.rb ( line 13) I have
config/initializers/devise.rb
Devise.setup do |config|
…/…
(13) config.mailer_sender = 'no-reply#' + Rails.application.secrets.domain_name
…/…
which lead to the config/secrets.yml file
config/secrets.yml
development:
domain_name: example.com
it's quite understandable , as running rails c ( whithout RAILS_ENV) , I get
$ rails c
development environment (Rails 4.2.3)
irb: warn: can't alias context from irb_context.
irb(main):001:0> Rails.application.secrets.domain_name
=> "example.com"
this warning is also cryptic :
irb: warn: can't alias context from irb_context
could not find any info on Google search... but at least it runs in development ....
why this warning and error using RAILS_ENV ? any enlightenment welcome
too bad .. I should HAVE READ the latest 4.2 doc !!!
so I should NOT be using RAILS_ENV at all !!
$ rails console staging
Loading staging environment (Rails 4.2.3)
irb(main):001:0> exit
$ rails console development
Loading development environment (Rails 4.2.3)
irb: warn: can't alias context from irb_context.
irb(main):001:0> exit