Showing posts with label rails. Show all posts
Showing posts with label rails. Show all posts

2013/04/08

RailsでjQueryのコードが動かない場合

それは十中八九お前のJavaScriptのコードがおかしい。
jQueryの.live()はv1.9で廃止されたぞ。.on()になったぞ。確認したか? 

3時間前の俺へ。

2012/05/20

syntax error, unexpected '\n', expecting tCOLON2

c:\Sites\JobChecker>rake db:migrate rake aborted! c:/Sites/JobChecker/db/migrate/20120515111707_create_execute_units.rb:4: syntax error, unexpected '\n', expecting tCOLON2 or '[' or '.' Tasks: TOP => db:migrate (See full trace by running task with --trace)
こんなエラーが出て、なんだと思ったが、
rails generate model execute_unit name:string, comment:string, ...
みたいについうっかりカンマ区切りしてたせいでmigrationファイルにもコンマが混入してたのが原因。「t.string, :name」みたいになっていた。rails generateコマンドのほうでエラーにしといてくれよ。