Closed justin808 closed 7 years ago
https://github.com/shakacode/react_on_rails-test-new-redux-generation/pull/16 is a newly generated app.
It deploys to heroku just fine: https://react-on-rails-redux-generator.herokuapp.com/
The cause of the issue was due to an invalid value in config/react_on_rails.rb
config.i18n_dir = Rails.root.join("client", "app", "libs", "i18n")
The above directory did not exist!
The deploy error was:
Errno::ENOENT: No such file or directory @ rb_sysopen - /tmp/build_1444a5bb9dd16ddb2561c7aff40f0fc7/some-app-816d31e9896edd90cecf1402acd002c724269333/client/app/libs/i18n/translations.js
@justin808 I am getting the same error while deployment 'Error configuring /config/react_on_rails.rb:config.i18n_dir
. Directory does not exist:'
After changing to 6.6.0 I get the below error
**bundle exec rake react_on_rails:locale**
warning: parser/current is loading parser/ruby23, which recognizes
warning: 2.3.3-compliant syntax, but you are running 2.3.1.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
rake aborted!
**Don't know how to build task 'react_on_rails:locale' (see --tasks)**
/var/lib/jenkins/.rbenv/versions/2.3.1/bin/bundle:23:in `load'
/var/lib/jenkins/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)
rake aborted!
**Command failed with status (1): [bundle exec rake react_on_rails:locale...]**
Does this mean we cannot use react_on_rails i18n setup with version 6.6.0 setup ?
@amf9t2 Please update to current 6.9.3 and let me know if you still see issues.
I still see issues at 6.9.3 version
rake aborted!
Error configuring /config/react_on_rails.rb: invalid value for config.i18n_dir
. Directory does not exist: /var/www/scry/tmp/build-149161890412039/client/app/libs/i18n. Set to value to nil or comment it out if not using this i18n with React on Rails.
/var/www/scry/tmp/build-149161890412039/vendor/bundle/ruby/2.3.0/gems/react_on_rails-6.9.3/lib/react_on_rails/configuration.rb:23:in check_i18n_directory_exists' /var/www/scry/tmp/build-149161890412039/vendor/bundle/ruby/2.3.0/gems/react_on_rails-6.9.3/lib/react_on_rails/configuration.rb:15:in
setup_config_values'
/var/www/scry/tmp/build-149161890412039/vendor/bundle/ruby/2.3.0/gems/react_on_rails-6.9.3/lib/react_on_rails/configuration.rb:4:in configure' /var/www/scry/tmp/build-149161890412039/config/initializers/react_on_rails.rb:2:in
<top (required)>
@trungnguyencmu and @amf9t2 Please change the value you have set in your react_on_rails.rb file: config.i18n_dir
That's all you have to do.
@justin808 Your mean, delete this line config.i18n_dir = Rails.root.join("client", "app", "libs", "i18n")
.
Delete or set it to nil.
if don't set it, It will not generate when deploy, And announce error because can't find libs/i18n/translations
@trungnguyencmu If you can give this a better error message, that would be great!
My error that I got 🗡 thanks @justin808
@trungnguyencmu my eyes bleed from so many double dots.
Use a webpack path alias so you don't have to do that!
I have added alias, It's still run fine on my local. But I still got error when deploy
.
If I delete config.i18n_dir = Rails.root.join("client", "app", "libs", "i18n")
, how to system generate translations.js or default.js to libs/i18n
your error now is related to your production setup
Thanks @justin808
I fixed this issue by creating client/app/libs/i18n
folder and commit it to repo (by creating .keep file inside and add it to repo). It seems that this folder is not auto created at production. I am using version 6.7.1
@phanhaiquang I guess this is the only way around for this problem. @justin808 if we delete the configuration or make it null then how we will generate the translations file. Do you mean remove it after generating the translations file (assets)?
@amf9t2:
if we delete the configuration or make it null then how we will generate the translations file. Do you mean remove it after generating the translations file (assets)?
If you're using i18n, then you want the configuration. Please open a new ticket to focus on your specific issue.
Created new issue - https://github.com/shakacode/react_on_rails/issues/818 Thanks.
Please revert to 6.6.0 if you run into this...
This will be fixed this evening.