ruby on rails - foreman not getting enviroment variables -
i'm using foreman enviroment variables in rails app. on config/enviroments/development.rb have following code:
config.action_mailer.smtp_settings = { address: "smtp.gmail.com", port: "587", domain: "gmail.com", authentication: "plain", enable_starttls_auto: true, user_name: env['gmail_username'], password: env['gmail_password'] #user_name: "user@gmail.com", #password: "password" }
and .env file follows:
gmail_username=user@gmail.com gmail_password=password
and procfile is:
web: bundle exec rvmsudo rails s -p 80
so if run "foreman start", following message:
net::smtpauthenticationerror in devise::confirmationscontroller#create 530-5.5.1 authentication required
however if comment lines concern enviroment variables , uncomment ones commented right @ development.rb, works fine.
so imagine problem foreman not getting enviroment variables correctly. i'm using git branches, , ignoring both procfile , .env
is there wrong code?
thanks!
looks environment variables not being set. method using that? here's article explains several methods.
try setting them manually on command line thus:
export gmail_username="user@gmail.com" export gmail_password="password"
then type env
@ command prompt verify set. give whirl.
Comments
Post a Comment