React-native-config: `read': Is a directory

Created on 21 Sep 2017  路  6Comments  路  Source: luggit/react-native-config

After updating xcode to latest 9.0 beta 6

I鈥檓 getting this error.

./ReactNativeConfig/BuildDotenvConfig.ruby:20:in `read': Is a directory - _/Users/user/project/node_modules/react-native-config/ios/../../../_ (Errno::EISDIR)
    from ./ReactNativeConfig/BuildDotenvConfig.ruby:20:in `<main>'
Reading env from 
Command /bin/sh failed with exit code 1./ReactNativeConfig/BuildDotenvConfig.ruby:20:in `read': Is a directory - /Users/user/project/node_modules/react-native-config/ios/../../../ (Errno::EISDIR)
    from ./ReactNativeConfig/BuildDotenvConfig.ruby:20:in `<main>'
Reading env from 
Command /bin/sh failed with exit code 1

Most helpful comment

I am running into this issue, is there any way to fix it without editing the package code?

All 6 comments

update: I had to change raw = File.read(File.join(Dir.pwd, "../../../#{file}"))
to raw = File.read(File.join(Dir.pwd, "../../../.env")) for it to work

Interesting, did you set it up with a Podfile?

Same problem for me.
@pedro Yes, I'm using a Podfile

source 'https://github.com/CocoaPods/Specs.git'
react_native_path = '../node_modules/react-native'

target 'Project' do

  # Uncomment this line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  pod 'React', :path => react_native_path, :subspecs => [
    'Core',
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'CxxBridge', # Include this for RN >= 0.47
    'RCTText',
    'RCTGeolocation',
    'RCTImage',
    'RCTNetwork',
    'RCTWebSocket', # needed for debugging
  ]

  pod 'yoga', :path => react_native_path + '/ReactCommon/yoga'

  # Third party deps
  pod 'DoubleConversion', :podspec => react_native_path + '/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => react_native_path + '/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => react_native_path + '/third-party-podspecs/Folly.podspec'

  pod 'react-native-pdf', :path => '../node_modules/react-native-pdf'
  pod 'react-native-fetch-blob', :path => '../node_modules/react-native-fetch-blob'
  pod 'react-native-camera', :path => '../node_modules/react-native-camera'

  target 'NetBankAppTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

In my case, the error is on line 28 of BuildDotenvConfig.ruby

./ReactNativeConfig/BuildDotenvConfig.ruby:28:in `read': Is a directory - /Users/fconstant/Projects/crefisa/app/node_modules/react-native-config/ios/../../../ (Errno::EISDIR)
    from ./ReactNativeConfig/BuildDotenvConfig.ruby:28:in `<main>'
Reading env from 
Command /bin/sh failed with exit code 1

I am running into this issue, is there any way to fix it without editing the package code?

Any fix for this ???

For my case, I put a wrong string in "Pre-actions" script as cho ".env.staging" > /tmp/envfile # replace .env.staging for your file but it should be echo ".env.staging" > /tmp/envfile # replace .env.staging for your file

yes, I missed "e"! cho -> echo, and the error dismissed!

@damathryx @Fconstant @wouterNL @pritasam you guys maybe can check that :)

and everything goes well, nice job! Thanks for the authors!

Was this page helpful?
0 / 5 - 0 ratings