前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Mac 下基于ruby 1.9安装Rails

Mac 下基于ruby 1.9安装Rails

作者头像
EltonZheng
发布2021-01-26 14:59:00
5640
发布2021-01-26 14:59:00
举报

ruby 1.9.1出来了,今天用它安装了rails。 一次成功, 将过程记录下来,备忘。


源码安装Ruby ************* tar xvzf ruby-1.9.1-p0.tar.gz cd ruby-1.9.1

./configure –enable-shared –enable-pthread CFLAGS=-D_XOPEN_SOURCE=1

make sudo make install


安装Ruby ************* sudo gem install rails

升级gem sudo gem update –system


安装Ruby for sqlite3 ************* sudo gem install sqlite3-ruby


源码安装MySQL ************* tar xvzf mysql-5.1.34.tar.gz cd mysql-5.1.34.tar.gz

CC=gcc CFLAGS=”-O3 -fno-omit-frame-pointer” CXX=gcc CXXFLAGS=”-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti” ./configure –prefix=/usr/local/mysql –with-extra-charsets=complex –enable-thread-safe-client –enable-local-infile –disable-shared –with-plugins=innobase

make sudo make install

cd /usr/local/mysql sudo ./bin/mysql_install_db –user=mysql sudo chown -R mysql ./var/ sudo chgrp -R mysql .

cd /Library/LaunchDaemons sudo vim com.mysql.mysqld.plist 输入

<?xml version=”1.0” encoding=”UTF-8”?> <!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”> <plist version=”1.0”> <dict> <key>KeepAlive</key> <true/> <key>Label</key> <string>com.mysql.mysqld</string> <key>Program</key> <string>/usr/local/mysql/bin/mysqld\_safe</string> <key>RunAtLoad</key> <true/> <key>UserName</key> <string>mysql</string> <key>WorkingDirectory</key> <string>/usr/local/mysql</string> </dict> </plist>

sudo chown root /Library/LaunchDaemons/com.mysql.mysqld.plist

启动MySQL sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist

手工停止MySQL sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist


设置路径 ************* mate ~/.bash_login 或者 mate ~/.profile

添加: export PATH=”/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH”

为了使其生效, 执行 . ~/.bash_login 或者 . ~/.profile


源码安装MySQL C Binding for Ruby *************

tar xvzf mysql-ruby-2.8.1 cd mysql-ruby-2.8.1 ruby extconf.rb –with-mysql-config=/usr/local/mysql/bin/mysql_config -with-mysql-dir=/usr/local/mysql make sudo make install


本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 SQL Server
腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档