0

working on setting up a simple dev environment while i learn Meteor (built on Node.js)

starting with a simple test, in env.sh i have only:

export CUSTOM_VAR="some value"

then in app.js, I have:

if (Meteor.isClient) {
  console.log(Meteor.settings);
}

if (Meteor.isServer) {
  console.log('Meteor Settings:');
  console.log(Meteor.settings);

  console.log('');
  console.log('Environment Variables:');
  console.log(process.env);
  console.log(process.env.CUSTOM_VAR);
}

the results i get seem to be variables from some other env.sh, and CUSTOM_VAR comes up undefined.

once it came up fine with "some value", but then not again (and i've done everything consistently)

here are full results:

I20150113-02:23:27.169(-8)? Meteor Settings:  
I20150113-02:23:30.006(-8)? {}
I20150113-02:23:30.007(-8)? 
I20150113-02:23:30.007(-8)? Environment Variables:
I20150113-02:23:30.007(-8)? { VIRTUALENVWRAPPER_PROJECT_FILENAME: '.project',
I20150113-02:23:30.007(-8)?   TERM_PROGRAM: 'Apple_Terminal',
I20150113-02:23:30.007(-8)?   TERM: 'xterm-256color',
I20150113-02:23:30.008(-8)?   SHELL: '/bin/bash',
I20150113-02:23:30.008(-8)?   TMPDIR: '/var/folders/tl/pcrp79f50t1_j0v_kxzdnzyw0000gn/T/',
I20150113-02:23:30.008(-8)?   Apple_PubSub_Socket_Render: '/tmp/launch-u46zHS/Render',
I20150113-02:23:30.008(-8)?   TERM_PROGRAM_VERSION: '309',
I20150113-02:23:30.008(-8)?   OLDPWD: '/Users/mac/.meteor/packages/meteor-tool/1.0.38/meteor-tool-os.osx.x86_64',
I20150113-02:23:30.009(-8)?   TERM_SESSION_ID: '48EC052B-755D-4025-8E90-A2353211C791',
I20150113-02:23:30.009(-8)?   USER: 'mac',
I20150113-02:23:30.009(-8)?   COMMAND_MODE: 'unix2003',
I20150113-02:23:30.009(-8)?   SSH_AUTH_SOCK: '/tmp/launch-TQwj0K/Listeners',
I20150113-02:23:30.009(-8)?   __CF_USER_TEXT_ENCODING: '0x1F5:0:0',
I20150113-02:23:30.009(-8)?   Apple_Ubiquity_Message: '/tmp/launch-WV3DC1/Apple_Ubiquity_Message',
I20150113-02:23:30.010(-8)?   WORKON_HOME: '/Users/mac/Users/mac/.virtualenvs',
I20150113-02:23:30.010(-8)?   PROJECT_HOME: '/Users/mac/_DEV',
I20150113-02:23:30.010(-8)?   PATH: '/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin',
I20150113-02:23:30.010(-8)?   VIRTUALENVWRAPPER_HOOK_DIR: '/Users/mac/Users/mac/.virtualenvs',
I20150113-02:23:30.010(-8)?   PWD: '/Users/mac/_INTRA/_APPS/Meteor_test/todos/app',
I20150113-02:23:30.010(-8)?   LANG: 'en_US.UTF-8',
I20150113-02:23:30.011(-8)?   SHLVL: '1',
I20150113-02:23:30.011(-8)?   HOME: ...
I20150113-02:23:30.011(-8)?   LOGNAME: ...
I20150113-02:23:30.011(-8)?   PORT: ...
I20150113-02:23:30.011(-8)?   ROOT_URL: 'http://localhost:3000/',
I20150113-02:23:30.011(-8)?   MONGO_URL: 'mongodb://127.0.0.1:3001/meteor',
I20150113-02:23:30.012(-8)?   MOBILE_DDP_URL: 'http://localhost:3000',
I20150113-02:23:30.012(-8)?   MOBILE_ROOT_URL: 'http://localhost:3000',
I20150113-02:23:30.012(-8)?   MONGO_OPLOG_URL: 'mongodb://127.0.0.1:3001/local',
I20150113-02:23:30.012(-8)?   APP_ID: ...
I20150113-02:23:30.012(-8)?   NODE_ENV: 'development',
I20150113-02:23:30.012(-8)?   HTTP_FORWARDED_COUNT: '1',
I20150113-02:23:30.013(-8)?   ENABLE_METEOR_SHELL: 'true' }
I20150113-02:23:30.013(-8)? undefined

This line in particular is interesting:

I20150113-02:23:30.010(-8)?   PATH: '/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin',

Why is the path in a Python folder? I think that maybe I set up a global environment in python some years ago? I'm new to this environment stuff. Any insight in how to resolve this?

gaio
  • 41
  • 4
  • also, when ever i open a new terminal window, i get this: `code`Traceback (most recent call last): File "", line 1, in ImportError: No module named virtualenvwrapper.hook_loader virtualenvwrapper.sh: There was a problem running the initialization hooks. If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenv has been installed for VIRTUALENVWRAPPER_PYTHON=/Library/Frameworks/Python.framework/Versions/2.7/bin/python and that PATH is set properly.`code` – gaio Jan 13 '15 at 11:17
  • This has been happening ever since I tried to set up a virtual environment for Python over a year ago. I've never been able to figure it out. – gaio Jan 13 '15 at 11:20
  • Have you tried checking this in a callback to `Meteor.startup`? Maybe it makes a difference. – Peppe L-G Jan 13 '15 at 13:32
  • I'm not sure what the issue could be here but this should be rather trivial to trouble shoot.. at the command prompt type VARX="Test String" node then at the node prompt type process.env.VARX and it should spit back "Test String" – Kelly Copley Jan 13 '15 at 21:00

0 Answers0