Ruby 板


LINE

我主要参考了以下几篇作为安装教学指引 XDite:Best Practice of installing Ruby on Rails on clean Mac http://blog.xdite.net/?p=2063 ihower:Ruby on Rails实战圣经 http://ihower.tw/rails3/installation.html 以及很多在stackoverflow.com上面的文章 主要在安装mysql的地方遇到了很多问题,我尽量把我的安装过程及遇到的情况描述清楚 有些问题看起来好像我已经解决了,事实上我不太明白为什麽这样可以解决 所以可以的话也请不吝解释一下(跪 因此文章很长,但恳请帮我解惑,我撞墙撞好几天了Orz -----------------------------------以下开始过程------------------------------- 一开始我使用brew install mysql来安装mysql,安装完後 unset TMPDIR mysql_install_db <=这里会出现以下错误(问题一) FATAL ERROR: Could not find ./bin/my_print_defaults 因此我将mysql_install_db改为安装时系统提示的 mysql_install_db --verbose --user=`whoami` \ --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql \ --tmpdir=/tmp 就可以安装了,接下来再执行 launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist 跳出了com.mysql.mysqld: Already loaded错误 我就将这玩意儿先unload掉...(事实上若它已经load我应该不用管它是吧?) launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist 就可以执行那段load了 再来执行/usr/local/Cellar/mysql/5.5.10/bin/mysql_secure_installation 照着指示可以顺利安装,然後接着把RVM REE都安装好 我中间试着想安装1.9.2的ruby时,使用rvm instal 1.9.2的指令无法安装 出现以下的错误讯息: ERROR: Error running 'make ', please read /Users/mary/.rvm/log/ruby-1.9.2-p180/make.log ERROR: There has been an error while running make. Halting the installation. 我照着人家的指示自己重新下载编译Readline(事实上在此之前我根本还没装Readline) curl -O ftp://ftp.gnu.org/gnu/readline/readline-6.1.tar.gz tar xzvf readline-6.1.tar.gz cd readline-6.1 ./configure --prefix=/usr/local make sudo make install cd .. rvm remove 1.9.2 rvm install 1.9.2 -C --enable-shared,--with-readline-dir=/usr/local 这样就可以顺利安装1.9.2了,但为什麽没办法像书上或是ihower网页上直接 rvm install 1.9.2来安装呢?(问题二) 接着继续照着XDite的说明继续安装其他的Ruby Gems,设定网页伺服器 安装passenger,修改httpd.conf,开启virtuall host,重开apache後 我就打算来测试我的ror,主要是参考ruby guides上面的指示 http://guides.ruby.tw/rails3/getting_started.html cd ~/.work rails new blog -d mysql cd blog bundle install sudo vim config/database.yml修改以下mysql资讯 development: adapter: mysql2 encoding: utf8 reconnect: false database: blog_development pool: 5 username: root password:e04su3su;6 socket: /tmp/mysql.sock 接着rake db:create....马上跳出以下错误 WARNING: This version of mysql2 (0.3.2) doesn't ship with the ActiveRecord adapter bundled anymore as it's now part of Rails 3.1 WARNING: Please use the 0.2.x releases if you plan on using it in Rails <= 3.0.x WARNING: Global access to Rake DSL methods is deprecated. Please Include ... Rake::DSL into classes and modules which use the Rake DSL methods. WARNING: DSL method Blog::Application#task called at /Users/apple/.rvm/gems/ ree-1.8.7-2011.03/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks' rake aborted! syntax error on line 15, col 2: ` socket: /tmp/mysql.sock' 看起来像是mysql2的版本跟我的rails感情不是很好... google後找到一个解法是这样... sudo gem install mysql2-0.2.7 sudo vim Gemfile 加上 gem 'mysql2', '0.2.7' 然後再rake db:create後变成这个错误... WARNING: Global access to Rake DSL methods is deprecated. Please Include ... Rake::DSL into classes and modules which use the Rake DSL methods. WARNING: DSL method Blog::Application#task called at /Users/apple/.rvm/gems /ree-1.8.7-2011.03/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks' rake aborted! syntax error on line 15, col 2: ` socket: /tmp/mysql.sock' Tasks: TOP => db:create => db:load_config (See full trace by running task with --trace) 发现是config.database.yml里的password:後面要空一格才能接密码,修改存档後 重新rake db:create...发现他开始疯狂的给我 Access denied for user 'root'@'localhost' (using password: YES) 然後不论是mysql -uroot,mysql -u root -p都一直给我deny 继续google发现人家说必须安装64位元的mysql,但我装不起来!!!! 真的是这样的方法吗orz... 请高手指点一下....我到底要怎麽把这个mysql弄好咧... --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 60.245.112.157







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:Boy-Girl站内搜寻

TOP