- 浏览: 2087407 次
- 性别:
- 来自: NYC
-
文章分类
- 全部博客 (628)
- Linux (53)
- RubyOnRails (294)
- HTML (8)
- 手册指南 (5)
- Mysql (14)
- PHP (3)
- Rails 汇总 (13)
- 读书 (22)
- plugin 插件介绍与应用 (12)
- Flex (2)
- Ruby技巧 (7)
- Gem包介绍 (1)
- javascript Jquery ext prototype (21)
- IT生活 (6)
- 小工具 (4)
- PHP 部署 drupal (1)
- javascript Jquery sort plugin 插件 (2)
- iphone siri ios (1)
- Ruby On Rails (106)
- 编程概念 (1)
- Unit Test (4)
- Ruby 1.9 (24)
- rake (1)
- Postgresql (6)
- ruby (5)
- respond_to? (1)
- method_missing (1)
- git (8)
- Rspec (1)
- ios (1)
- jquery (1)
- Sinatra (1)
最新评论
-
dadadada2x:
user模型里加上 protected def email ...
流行的权限管理 gem devise的定制 -
Sev7en_jun:
shrekting 写道var pattern = /^(0| ...
强悍的ip格式 正则表达式验证 -
jiasanshou:
好文章!!!
RPM包rpmbuild SPEC文件深度说明 -
寻得乐中乐:
link_to其实就是个a标签,使用css控制,添加一个参数: ...
Rails在link_to中加参数 -
aiafei0001:
完全看不懂,不知所然.能表达清楚一点?
"$ is not defined" 的问题怎么办
Updated 2012/7/30
if you are using ubuntu 12, try
1. 安裝 RubyWorks
安裝 RubyWorks Repo
用 yum 安裝 RubyWorks
yum install rubyworks 出現下面一堆東西,按 y 一直裝完就是了
--------------------------------------------------------------------------------------------------------
先不管,再往下安裝
2. 安裝 MySQL
RubyWorks 好歸好,就是沒有選擇讓我們裝 DB Server,我們這裡就直接用 yum 安裝 MySQL
yum install mysql-server
3. 安裝 Ruby MySQL Native Lib
我發現到 RubyWorks 並不會安裝 Ruby MySQL Native Lib,所以我們得用 gem 安裝,但是又發現 centos 上面安裝 MySQL Gem 會出現這樣的錯誤訊息,網路上也有人在 complian。
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lm… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lz… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lsocket… no
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lnsl… yes
checking for mysql_query() in -lmysqlclient… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
–with-opt-dir
所以得先 remove MySQL 然後再重新安裝 MySQL 跟 MySQL Development Lib
要在 CentOS 安裝 Rails Gem,那就
gem i rails -y 即可。
就選 3 最新的
至於為何這樣,我也不太清楚。能動就好了。
以上是節錄自 http://lightyror.thegiive.net/2007/06/centos-ruby-on-rails.html 有些紅色的是我改過的
if you are using ubuntu 12, try
sudo aptitude install libmysqlclient-dev
1. 安裝 RubyWorks
安裝 RubyWorks Repo
wget [url=http://rubyworks.rubyforge.org/public_key.txt]http://rubyworks.rubyforge.org/public_key.txt[/url] sudo rpm --import public_key.txt wget [url=http://rubyworks.rubyforge.org/RubyWorks.repo]http://rubyworks.rubyforge.org/RubyWorks.repo[/url] cp RubyWorks.repo /etc/yum.repos.d/
用 yum 安裝 RubyWorks
yum install rubyworks 出現下面一堆東西,按 y 一直裝完就是了
--------------------------------------------------------------------------------------------------------
[root@vmcentos5 ~]# yum install rubyworks Loading "installonlyn" plugin Setting up Install Process Setting up repositories rubyworks 100% |=========================| 951 B 00:00 base 100% |=========================| 1.1 kB 00:00 updates 100% |=========================| 951 B 00:00 addons 100% |=========================| 951 B 00:00 extras 100% |=========================| 1.1 kB 00:00 Reading repository metadata in from local files primary.xml.gz 100% |=========================| 2.2 kB 00:00 rubyworks : ################################################## 6/6 Added 6 new packages, deleted 0 old in 0.05 seconds Parsing package install arguments Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Downloading header for rubyworks to pack into transaction set. rubyworks-0.0.1-1.i386.rp 100% |=========================| 4.7 kB 00:00 ---> Package rubyworks.i386 0:0.0.1-1 set to be updated --> Running transaction check --> Processing Dependency: monit >= 4.9 for package: rubyworks --> Processing Dependency: ruby >= 1.8.5 for package: rubyworks --> Processing Dependency: ruby-devel >= 1.8.5 for package: rubyworks --> Processing Dependency: rubygems >= 0.9.2 for package: rubyworks --> Processing Dependency: haproxy >= 1.2.17 for package: rubyworks --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for rubygems to pack into transaction set. rubygems-0.9.2-1.i386.rpm 100% |=========================| 7.7 kB 00:00 ---> Package rubygems.i386 0:0.9.2-1 set to be updated ---> Downloading header for ruby to pack into transaction set. ruby-1.8.5-5.el5.i386.rpm 100% |=========================| 35 kB 00:00 ---> Package ruby.i386 0:1.8.5-5.el5 set to be updated ---> Downloading header for haproxy to pack into transaction set. haproxy-1.2.17-1.i386.rpm 100% |=========================| 4.4 kB 00:00 ---> Package haproxy.i386 0:1.2.17-1 set to be updated ---> Downloading header for ruby-devel to pack into transaction set. ruby-devel-1.8.5-5.el5.i3 100% |=========================| 22 kB 00:00 ---> Package ruby-devel.i386 0:1.8.5-5.el5 set to be updated ---> Downloading header for monit to pack into transaction set. monit-4.9-1.i386.rpm 100% |=========================| 4.2 kB 00:00 ---> Package monit.i386 0:4.9-1 set to be updated --> Running transaction check --> Processing Dependency: ruby-libs = 1.8.5-5.el5 for package: ruby-devel --> Processing Dependency: gcc for package: rubygems --> Processing Dependency: flex for package: monit --> Processing Dependency: ruby-libs = 1.8.5-5.el5 for package: ruby --> Processing Dependency: libcrypto.so.4 for package: monit --> Processing Dependency: libruby.so.1.8 for package: ruby --> Processing Dependency: libssl.so.4 for package: monit --> Processing Dependency: libruby.so.1.8 for package: ruby-devel --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for ruby-libs to pack into transaction set. ruby-libs-1.8.5-5.el5.i38 100% |=========================| 74 kB 00:00 ---> Package ruby-libs.i386 0:1.8.5-5.el5 set to be updated ---> Downloading header for gcc to pack into transaction set. gcc-4.1.1-52.el5.2.i386.r 100% |=========================| 59 kB 00:00 ---> Package gcc.i386 0:4.1.1-52.el5.2 set to be updated ---> Downloading header for openssl097a to pack into transaction set. openssl097a-0.9.7a-9.i386 100% |=========================| 22 kB 00:00 ---> Package openssl097a.i386 0:0.9.7a-9 set to be updated ---> Downloading header for flex to pack into transaction set. flex-2.5.4a-41.fc6.i386.r 100% |=========================| 8.3 kB 00:00 ---> Package flex.i386 0:2.5.4a-41.fc6 set to be updated --> Running transaction check --> Processing Dependency: libgcc >= 4.1.1-52.el5.2 for package: gcc --> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc --> Processing Dependency: libgomp.so.1 for package: gcc --> Processing Dependency: libgomp = 4.1.1-52.el5.2 for package: gcc --> Processing Dependency: cpp = 4.1.1-52.el5.2 for package: gcc --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for glibc-devel to pack into transaction set. glibc-devel-2.5-12.i386.r 100% |=========================| 105 kB 00:00 ---> Package glibc-devel.i386 0:2.5-12 set to be updated ---> Downloading header for libgcc to pack into transaction set. libgcc-4.1.1-52.el5.2.i38 100% |=========================| 49 kB 00:00 ---> Package libgcc.i386 0:4.1.1-52.el5.2 set to be updated ---> Downloading header for cpp to pack into transaction set. cpp-4.1.1-52.el5.2.i386.r 100% |=========================| 52 kB 00:00 ---> Package cpp.i386 0:4.1.1-52.el5.2 set to be updated ---> Downloading header for libgomp to pack into transaction set. libgomp-4.1.1-52.el5.2.i3 100% |=========================| 49 kB 00:00 ---> Package libgomp.i386 0:4.1.1-52.el5.2 set to be updated --> Running transaction check --> Processing Dependency: glibc-headers for package: glibc-devel --> Processing Dependency: glibc-headers = 2.5-12 for package: glibc-devel --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for glibc-headers to pack into transaction set. glibc-headers-2.5-12.i386 100% |=========================| 138 kB 00:00 ---> Package glibc-headers.i386 0:2.5-12 set to be updated --> Running transaction check Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Installing: rubyworks i386 0.0.1-1 rubyworks 19 k Installing for dependencies: flex i386 2.5.4a-41.fc6 base 124 k gcc i386 4.1.1-52.el5.2 updates 4.9 M glibc-devel i386 2.5-12 base 2.0 M glibc-headers i386 2.5-12 base 605 k haproxy i386 1.2.17-1 rubyworks 162 k libgomp i386 4.1.1-52.el5.2 updates 69 k monit i386 4.9-1 rubyworks 209 k openssl097a i386 0.9.7a-9 base 825 k ruby i386 1.8.5-5.el5 base 278 k ruby-devel i386 1.8.5-5.el5 base 554 k ruby-libs i386 1.8.5-5.el5 base 1.6 M rubygems i386 0.9.2-1 rubyworks 127 k Updating for dependencies: cpp i386 4.1.1-52.el5.2 updates 2.6 M libgcc i386 4.1.1-52.el5.2 updates 82 k Transaction Summary ============================================================================= Install 13 Package(s) Update 2 Package(s) Remove 0 Package(s) Total download size: 14 M Is this ok [y/N]: y Downloading Packages: (1/15): ruby-libs-1.8.5-5 100% |=========================| 1.6 MB 00:09 (2/15): glibc-headers-2.5 100% |=========================| 605 kB 00:03 (3/15): rubygems-0.9.2-1. 100% |=========================| 127 kB 00:02 (4/15): gcc-4.1.1-52.el5. 100% |=========================| 4.9 MB 00:27 (5/15): ruby-1.8.5-5.el5. 100% |=========================| 278 kB 00:01 (6/15): glibc-devel-2.5-1 100% |=========================| 2.0 MB 00:11 (7/15): openssl097a-0.9.7 100% |=========================| 825 kB 00:04 (8/15): libgcc-4.1.1-52.e 100% |=========================| 82 kB 00:00 (9/15): flex-2.5.4a-41.fc 100% |=========================| 124 kB 00:00 (10/15): cpp-4.1.1-52.el5 100% |=========================| 2.6 MB 00:06 (11/15): haproxy-1.2.17-1 100% |=========================| 162 kB 00:01 (12/15): libgomp-4.1.1-52 100% |=========================| 69 kB 00:00 (13/15): ruby-devel-1.8.5 100% |=========================| 554 kB 00:01 (14/15): rubyworks-0.0.1- 100% |=========================| 19 kB 00:00 (15/15): monit-4.9-1.i386 100% |=========================| 209 kB 00:01 warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897 Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) " from http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 Is this ok [y/N]: y Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: ruby-libs ####################### [ 1/17] Installing: ruby ####################### [ 2/17] Installing: ruby-devel ####################### [ 3/17] Installing: libgomp ####################### [ 4/17] Installing: haproxy ####################### [ 5/17] Updating : cpp ####################### [ 6/17] Installing: flex ####################### [ 7/17] Updating : libgcc ####################### [ 8/17] Installing: openssl097a ####################### [ 9/17] Installing: monit ####################### [10/17] Installing: glibc-headers ####################### [11/17] Installing: glibc-devel ####################### [12/17] Installing: gcc ####################### [13/17] Installing: rubygems ####################### [14/17] Installing: rubyworks ####################### [15/17] --20:38:03-- http://rubyworks.rubyforge.org/gems.tgz Resolving rubyworks.rubyforge.org... 205.234.109.18 Connecting to rubyworks.rubyforge.org|205.234.109.18|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 332051 (324K) [application/x-gzip] Saving to: `/tmp/gems.tgz' 100%[=======================================>] 332,051 156K/s in 2.1s 20:38:06 (156 KB/s) - `/tmp/gems.tgz' saved [332051/332051] Successfully installed rake, version 0.7.3 Successfully installed daemons, version 1.0.6 Building native extensions. This could take a while... Successfully installed fastthread, version 1.0 Successfully installed gem_plugin, version 0.2.2 Successfully installed cgi_multipart_eof_fix, version 2.1 Building native extensions. This could take a while... Successfully installed mongrel, version 1.0.1 Installing a skeleton Rails application into /usr/rails wget http://rubyworks.rubyforge.org/rails_skeleton.tgz -O /tmp/rails_skeleton.tgz /tmp/install_skeleton_app.rb:8: warning: Insecure world writable dir /usr, mode 040777 --20:38:12-- http://rubyworks.rubyforge.org/rails_skeleton.tgz Resolving rubyworks.rubyforge.org... 205.234.109.18 Connecting to rubyworks.rubyforge.org|205.234.109.18|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1597654 (1.5M) [application/x-gzip] Saving to: `/tmp/rails_skeleton.tgz' 100%[=======================================>] 1,597,654 377K/s in 5.2s 20:38:18 (297 KB/s) - `/tmp/rails_skeleton.tgz' saved [1597654/1597654] tar -zxf /tmp/rails_skeleton.tgz -C /usr find /usr/rails -exec chown rails {} \; find /usr/rails -exec chgrp rails {} \; Starting Process Monitor (monit): Starting monit daemon with http interface at [127.0.0.1:2812] [ OK ] Cleanup : libgcc ####################### [16/17] Cleanup : cpp ####################### [17/17] Installed: rubyworks.i386 0:0.0.1-1 Dependency Installed: flex.i386 0:2.5.4a-41.fc6 gcc.i386 0:4.1.1-52.el5.2 glibc-devel.i386 0:2.5-12 glibc-headers.i386 0:2.5-12 haproxy.i386 0:1.2.17-1 libgomp.i386 0:4.1.1-52.el5.2 monit.i386 0:4.9-1 openssl097a.i386 0:0.9.7a-9 ruby.i386 0:1.8.5-5.el5 ruby-devel.i386 0:1.8.5-5.el5 ruby-libs.i386 0:1.8.5-5.el5 rubygems.i386 0:0.9.2-1 Dependency Updated: cpp.i386 0:4.1.1-52.el5.2 libgcc.i386 0:4.1.1-52.el5.2 Complete! You have mail in /var/spool/mail/root [root@vmcentos5 ~]# --------------------------------------------------------------------------------------------------------- 安裝好 RubyWorks ,他會把 ruby,rubygems,Mongrel,Haproxy,Monit 安裝跟設定好。但是他不會安裝 Rails ,而是 copy 一份 Rails 在 /usr/rails 上面,這其實是很正確的作法,因為他一開始就取向 Production Server,而 Production Server 本來就該將 Rails 版本 Freeze 在 Rails Doc 裡面。 [root@vmcentos5 ~]# gem i rails -y Bulk updating Gem source index for: [url=http://gems.rubyforge.org/]http://gems.rubyforge.org[/url] ERROR: While executing gem ... (Gem::GemNotFoundException) Could not find rails (> 0) in any repository [root@vmcentos5 ~]#
先不管,再往下安裝
2. 安裝 MySQL
RubyWorks 好歸好,就是沒有選擇讓我們裝 DB Server,我們這裡就直接用 yum 安裝 MySQL
yum install mysql-server
3. 安裝 Ruby MySQL Native Lib
我發現到 RubyWorks 並不會安裝 Ruby MySQL Native Lib,所以我們得用 gem 安裝,但是又發現 centos 上面安裝 MySQL Gem 會出現這樣的錯誤訊息,網路上也有人在 complian。
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lm… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lz… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lsocket… no
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lnsl… yes
checking for mysql_query() in -lmysqlclient… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
–with-opt-dir
所以得先 remove MySQL 然後再重新安裝 MySQL 跟 MySQL Development Lib
yum remove mysql yum install mysql yum install mysql-devel
要在 CentOS 安裝 Rails Gem,那就
gem i rails -y 即可。
gem install mysql -- --with-mysql-include=/usr/include/mysql/mysql --with-mysql-lib=/usr/lib/mysql/最後那個步驟,會出現
[root@vmcentos5 ~]# gem install mysql -- --with-mysql-include=/usr/include/mysql/mysql --with-mysql-lib=/usr/lib/mysql/Select which gem to install for your platform (i386-linux) 1. mysql 2.7.3 (mswin32) 2. mysql 2.7.1 (mswin32) 3. mysql 2.7 (ruby) 4. mysql 2.6 (ruby) 5. Skip this gem 6. Cancel installation
就選 3 最新的
至於為何這樣,我也不太清楚。能動就好了。
以上是節錄自 http://lightyror.thegiive.net/2007/06/centos-ruby-on-rails.html 有些紅色的是我改過的
发表评论
-
在ubuntu中.profile 和.bashrc的加载区别
2013-06-01 21:38 2565总之,profile不只是bash,在启动加载 bashrc是 ... -
command line tools for linux
2013-02-14 23:49 1492du -sh `ls .` for i in G M K; ... -
ubuntu 12.10 proxy install package apt-get
2013-01-31 06:47 1231#/.bashrc export http_proxy= ... -
查找多文件内容替换
2012-09-14 20:58 1515UPDATE: (05/03/2013) 当前使用: # ... -
shell script
2012-09-11 21:08 1059select r.name, count(p.id) from ... -
定期清空日志文件
2012-09-11 10:04 3377一个关于如何在指定文件大于1GB后,自动删除的问题。 批处理代 ... -
查看一个进程占用了那个端口
2012-09-11 09:59 1738有时候需要在Linux下查看一个进程占用了那个端口,但是只知道 ... -
utf8 ruby1.9
2012-07-13 01:57 1369引用invalid byte sequence in utf- ... -
VIM下跳转的区别
2012-05-06 00:33 1410VIM在开tag和jumplist的时候有几个差别 经常用的 ... -
shell command
2012-04-11 21:42 946ls -l . | egrep -c '^d' ls -l . ... -
unbuntu 查看什么占着80端口
2012-01-19 12:37 1474sudo lsof -i :80 sudo nets ... -
处理僵尸进程
2011-05-27 01:45 1191#!/bin/sh kill -HUP `ps -A - ... -
ubuntu 看硬件配置
2011-05-02 02:03 5309总是忘记阿,标记一下 sudo lspci -v lshw ... -
no such file to load -- zlib
2011-04-25 23:52 2775或者提示 fatal error: zlib.h: No su ... -
新装的mysql出现无法登陆的问题 er 1405 参考下面的解决
2011-01-23 12:39 3118Installing MySQL 5.0 First we ... -
ssh无密码登入设置
2010-08-17 21:02 1429现有2台机器 1、服务器192.168.1.112 2、个人机 ... -
bash和乱码
2010-08-16 00:15 1935几个bash下配置的区别 1)/etc/profile: 此文 ... -
ubuntu 配置git服务器及其它
2010-08-15 23:46 2209update: 生产public key的时候不能按照git ... -
nohup命令让程序在后台运行-linux
2010-02-04 14:17 7086nohup ruby /sunrise/www/realwor ... -
shell 条件可能用到
2010-01-26 15:05 1560为什么不能用ruby脚本写啊,shell脚本写的俺很烦啊... ...
相关推荐
RoR通常在Unix类操作系统上运行最佳,如RHEL、CentOS、Ubuntu和SuSE Linux。对于AMD Opteron x86_64架构的服务器,SuSE Linux提供了更好的优化。64位操作系统能够充分利用硬件性能,但也会消耗更多内存。 文件系统...
通过Gem,我们可以安装和管理RoR和其他依赖项: ```bash sudo /usr/local/ruby/bin/gem install bundler ``` Bundler用于管理和解决Ruby项目依赖关系,确保每个项目都有正确的gem版本。 现在,我们继续安装数据库...
Redmine是一款基于Web的项目管理工具,由Ruby on Rails(简称ROR)框架构建,支持跨平台使用。它主要用于管理项目中的各种任务,包括Bug管理,涵盖了从新建、跟踪、解决到关闭的完整流程。本篇文章将详述如何在...
linux中的依赖包,centos10中package中的内容
是基于ROR框架开发的一套跨平台项目管理系统,是项目管理系统的后起之秀,据说是源于Basecamp的ror版而来,支持多种数据库,除了和DotProject的功能大致相当外,还有不少自己独特的功能,例如提供wiki、新闻台、时间...
安装 >= 1.2。 vagrant plugin install vagrant-berkshelf git clone git@github.com:1000k/rails_sandbox.git cp Vagrantfile.default Vagrantfile 编辑 Vagrantfile 中的变量。 vagrant up 现在你有了虚拟机...
此外,本文档提到的方法同样适用于 Ubuntu、Fedora、CentOS 和 Red Hat 等不同的 Linux 发行版。 2. **资源下载**: - **MySQL**:版本为 5.1.60,用于存储 Redmine 数据库。MySQL 是一种广泛使用的开源关系型...
对于使用SELinux的系统(如CentOS),默认的安全策略可能阻止MySQL启动。可以通过编辑`/etc/sysconfig/selinux`文件,将`SELINUX=enforcing`改为`SELINUX=disabled`来禁用SELinux,但这并不是长期解决方案,更安全...