0

I'm attempting to run Ruby on Rails and connect to a MS SQL DB. I have RoR installed and I have created the database to which I'll be connecting. I created and Test Model and when attempting $ rake db:migrate I got a rake aborted error (no such file to load -- tiny_tds). At this point I downloaded and unzipped FreeTDS. When I submit $ ./configure that the problems arise.

Below is the command and the resulting error message (Cygwin terminal on a Windows 7 Pro OS box):

$ ./configure

./configure: line 31: syntax error near unexpected token `newline'

'/configure: line 31: `;;

This is the code from FreeTDS configure file (lines 19-33):

    if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
  emulate sh

  NULLCMD=:

  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which

  # is contrary to our usage.  Disable this feature.

  alias -g '${1+"$@"}'='"$@"'

  setopt NO_GLOB_SUBST

else

  case `(set -o) 2>/dev/null` in #(

  *posix*) :

    set -o posix ;; #(

  *) : 

    ;;

esac

fi
Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
Was-a-golfer
  • 11
  • 1
  • 2

2 Answers2

0

This line in the error message:

'/configure: line 31: `;;

has the ' character at the beginning of the line because there's actually a return character in the token it's complaining about: ;;\r.

The configure script has Windows-style CR-LF line endings, which the shell doesn't recognize; it requires Unix-style LF line endings, and treats the CR as an ordinary character, resulting in syntax errors.

Filter the configure script using dos2unix to convert it to Unix-style line endings.

Be sure to read the dos2unix man page first; unlike most text filters, it overwrites its input file by default.

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
0

Solved!! Initially I unzipped the freetds download with Winzip. After struggling with the above problem, I deleted the download. Redownloaded and then extracted using UNIX command. Works fine now.

Was-a-golfer
  • 11
  • 1
  • 2