Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJoshua Shroy
9,943 PointsRails: "URI::InvalidURIError" and "Port 22" timeout.
Stack Overflow original post: http://stackoverflow.com/questions/26290541/rails-4-env-variables-bash-profile-and-heroku
I am following along with the "Learn Ruby on Rails" tutorial by Daniel Kehoe. Everything was working great until I switched to a new computer.
I recently transferred my rails app from a PC running Ubuntu 14.04 to a new Macbook Pro. On the Ubuntu computer, my .bash_profile has the following ENV variables set up:
export GMAIL_USERNAME=“example@gmail.com”
export GMAIL_PASSWORD=“‘app-specific-password’”
export MAILCHIMP_API_KEY=“random-key”
export MAILCHIMP_LIST_ID=“list-id”
export OWNER_EMAIL=“example@gmail.com”
export SECRET_KEY_BASE=“random-key”
On the mac, I opened .bash_profile and added the same info. I run the rails server and my home page opens, but if I try to submit an email in my subscribe form I get the following error:
URI::InvalidURIError at /visitors
bad URI(is not URI?): https://us9”.api.mailchimp.com/2.0/lists/subscribe
It shows the problem on line 9:
7 def subscribe
8 mailchimp = Gibbon::API.new(Rails.application.secrets.mailchimp_api_key)
9 result = mailchimp.lists.subscribe({
10 :id => Rails.application.secrets.mailchimp_list_id,
11 :email => {:email => self.email},
12 :double_optin => false,
13 :update_existing => true,
14 :send_welcome => true
I tried changing my mailchimp_api_key, but was unable to solve the issue, so I decided to continue through the tutorial. The next chapter was on Heroku which required creating the same ENV variables. I followed the process thoroughly but received this error after running the git push heroku master:
ssh: connect to host heroku.com port 22: Operation timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists. Any ideas on what could be going on?
................
UPDATE
After reading some similar issues, I decided to check out port 22 by running the ssh -vT git@github.com and received this:
debug1: connect to address 192.30.252.129 port 22: Operation timed out
ssh: connect to host github.com port 22: Operation timed out
I enabled "Remote Login" in System Preferences > Sharing and still no luck.
I am running Mac OSX 10.9.5.