I set environment variables at .bash_profile
as below for Oauth
export TWITTER_KEY=xxxxxxxxxxxxx
export TWITTER_SECRET=xxxxxxxxxxxxxxxxxxxxxxxx
If I run just rails server
without any option to boot WEBrick, ENV['TWITTER_KEY']
and ENV['TWITTER_SECRET']
can be accessed properly. But If running it with options like sudo rails server -b 127.0.0.1 -p 80
, it can't. These doesn't seem to be passed to Rails.
Why?
I use
Mac OSX 10.9.5
ruby 2.1.2p95
Rails 4.2.0.beta2
Thank you, in advance.