Skip to content
jorufo edited this page Feb 17, 2017 · 19 revisions

FAQs - Module 1

General Questions

Installation

Common Issues

General Questions


Q: Where are the FAQs from previous courses?

A: You may be able to find the answer to your question in the FAQs for a previous course if you can't find it here.

Here are links to FAQs from previous courses

Installation


Q: How can I install Imagemagick 6 on macOS?

A: [Here] (https://www.imagemagick.org/script/binary-releases.php#macosx) is a link to installing imagemagick 6 using MacPorts. Unfortunately Homebrew will only allow you to install version 7. There are workarounds to installing version 6 using Homebrew, but we haven't gotten any of them to work.

ImageMagic will not be necessary until Module 5. Prior to module 5 we will provide more info on a workaround for people who are only able to install version 7.

Q: How to downgrade from Rails 5?

A: For the course, the supported Rails version is Rails 4.2.6. If you used Rails Installer to download Rails 5, you can follow these instructions to downgrade to 4.2.6.

gem uninstall rails
gem uninstall railties

An them install the version you will need:

gem install rails -v 4.2.6

If you have multiple versions of Rails installed, just add the version that you want to uninstall to the end of the command:

gem uninstall rails -v 4.2.6    # uninstall version 4.2.6
gem uninstall railties -v 4.2.6

Q: What is the default Postgres password?(#q-what-is-the-default-postgres-password)

In Linux and MacOS X postgres is configured by default to only allow the user 'postgres' to connect to the Postgres database. This way of authentication is managed by a file called 'pg_hba.conf', which is located in /var/lib/pgsql/9.3/data (NOTE: In this example, the 9.3 is the specific version of postgres).

Run the following command to become user postgres: sudo -u postgres psql

Then, at the postgres command prompt, enter the following

postgres=> alter user postgres password 'apassword'; postgres=> create user your_username createdb createuser password 'somepass'; postgres=> create database your_username owner your_username; postgres=> \q

Please update your_username with the username you would like to use. This will now give you the ability to login to Postgres as yourself and connect with the password you supply.

Common Issues


Q: I get an error but when I look at my code I cannot see anything wrong with it. What should I do?

A: When working in a new language or environment it can be easy to make a mistake with syntax or mistype a function name. After looking at the code shown in the lecture videos, and comparing it to your own, you swear there is nothing wrong with your code. Unfortunately, the Ruby interpreter "thinks" otherwise.

When this happens, and after you have given an earnest effort to try to spot the error, resort to getting the code from the course's git repository. You can use the code from the repository to compare to your own code. Upon comparison, look for typos, syntax errors, or missing lines.

Here's how to get the code from the course's git repository:

Sections of the course have a git tags associated with them containing the code used in the lectures. Running git tag will list the available tags you can use.

  1. From the command prompt, type: git clone [email protected]:jhu-ep-coursera/capstone_demoapp.git courseRepo (You may replace courseRepo with whatever string you like.

  2. A new directory has been created called courseRepo. cd into that directory

  3. Checkout using the tag relevant to the lecture you are on. For instance, if you want to checkout the code for module2 then type the following

git checkout module2.start

  1. If you want to get a specific commit that was performed in module2, rather than getting the starting code, you can use the git log command to find that commit and check it out.

Here is an example section from git log:

commit 2a2eb5c2b2626d85bedf653c114e453f45791043
Author: jim [email protected]
Date: Sat Dec 3 17:42:26 2016 -0500
added pry-byebug

Now, you can use the value tied to "commit", shown in print out of the git log command, to jump to that specific commit. In this case containing the code that includes the addition of pry-bybug:

git checkout 2a2eb5c2b2626d85bedf653c114e453f45791043

Remember, git clean -df will remove files that are left over from latter branches, which might not be pertinent to earlier branches.

Q: How do you fix the following error: "Expected string default value for '--rc'; got false (boolean)"?

A: Adding the following entry in your Gemfile will stop this error from happening: gem 'thor', '~>0.19', '<=0.19.1'

Once added into the Gemfile run bundle again and try to run the rails server.

Q: How can I handle when a rails hangs and times out?

A: If you execute a command that causes the terminal to timeout or just hang without doing anything, Ctrl+C, or if that doesn't work just kill the process. Then try running spring stop, then re-run your command.

Clone this wiki locally