- 浏览: 849756 次
- 性别:
- 来自: lanzhou
文章分类
最新评论
-
liu346435400:
楼主讲了实话啊,中国程序员的现状,也是只见中国程序员拼死拼活的 ...
中国的程序员为什么这么辛苦 -
qw8226718:
国内ASP.NET下功能比较完善,优化比较好的Spacebui ...
国内外开源sns源码大全 -
dotjar:
敢问兰州的大哥,Prism 现在在12.04LTS上可用么?我 ...
最佳 Ubuntu 下 WebQQ 聊天体验 -
coralsea:
兄弟,卫星通信不是这么简单的,单向接收卫星广播信号不需要太大的 ...
Google 上网 -
txin0814:
我成功安装chrome frame后 在IE地址栏前加上cf: ...
IE中使用Google Chrome Frame运行HTML 5
初次使用Ubuntu,我想这个脚本会大大方便你配置Ubuntu,ruby on rails是本人的爱好,你也可以直接注释掉最后己行,只安装软件亦可 #!/bin/bash
RUBY_VERSION="1.8.6-p287"
RUBY_GEM_VERSION="1.3.1"
RAILS_APP_DEPLOYMENT_DIR="/var/www/rails"
MOD_RAILS_VERSION="2.0.3"
export LANG=C
#detect distro version
if [ -e /etc/redhat-release ]; then
DISTRO="redhat"
elif [ -e /etc/debian_version ]; then
DISTRO="debian"
fi
#set apt-get modifier based on distro
if [ $DISTRO == "redhat" ]; then
APTMOD=" -y "
elif [ $DISTRO == "debian" ]; then
APTMOD="-y --force-yes"
fi
#misc settings based on distro
if [ $DISTRO == "redhat" ]; then
RAILS_APP_CONFIG="/etc/httpd/conf.d/railsapps.conf"
MOD_RAILS_CONFIG="/etc/httpd/conf.d/mod_rails.conf"
elif [ $DISTRO == "debian" ]; then
RAILS_APP_CONFIG="/etc/apache2/conf.d/railsapps.conf"
MOD_RAILS_CONFIG="/etc/apache2/conf.d/mod_rails.conf"
fi
####################
# HELPER FUNCTIONS #
####################
##
# view std out and append to log
function echolog() {
echo $* | tee -a /root/install.log
}
##
# download file and cd there
function download() {
local name=$1
local version=$2
local url=$3
mkdir -p /usr/local/src
cd /usr/local/src
if [ -d /usr/local/src/$name-$version ]; then
echolog "$name directory already exists, skipping the download"
cd /usr/local/src/$name-$version
return 0
fi
echolog "Grabbing $name from $url"
wget -qO - $url | tar xz
if [ $? -ne 0 ]; then
echolog "failed getting $url" >&2
return 1
fi
cd /usr/local/src/$name-$version
}
##
# apt-get update
function aptgetupdate() {
echolog Performing system update via package manager
apt-get update
apt-get $APTMOD upgrade
}
function aptgetmysf(){
#install the software what i want, it works in Ubuntu
apt-get install $APTMOD nautilus-open-terminal
apt-get install $APTMOD compizconfig-settings-manager
apt-get install $APTMOD libxine1-ffmpeg libxine1-plugins w32codecs libdvdcss2
apt-get install $APTMOD gstreamer0.10-plugins-ugly gstreamer0.10-ffmpeg gstreamer0.10-fluendo-mpegdemux gstreamer0.10-gnonlin
apt-get remove $APTMOD totem-gstreamer -y
apt-get install $APTMOD totem totem-xine totem-mozilla -y
apt-get install $APTMOD mplayer mplayer-fonts mozilla-mplayer smplayer
apt-get install $APTMOD acroread
apt-get install $APTMOD mozilla-acroread
apt-get install $APTMOD acroread-plugins
# apt-get install $APTMOD gnochm
apt-get install $APTMOD flashplugin-nonfree
apt-get install $APTMOD rar unrar
apt-get install $APTMOD sun-java6-jre
apt-get install $APTMOD sun-java6-jdk
apt-get install $APTMOD sun-java6-plugin
apt-get install $APTMOD libgtk2.0-dev xorg-dev ncurses-dev build-essential # need by vim
apt-get install $APTMOD build-essential gcc make autoconf automake libtool gdb g++
}
##
# install prerequisites
function installprereqpackages() {
echolog Installing prerequisite packages via package manager
if [ $DISTRO == "redhat" ] ; then
apt-get $APTMOD install zlib-devel
apt-get $APTMOD install readline-devel readline
apt-get $APTMOD install mysql-devel
apt-get $APTMOD install libmysqlclient15-dev
apt-get $APTMOD install pcre pcre-devel
apt-get $APTMOD install which
apt-get $APTMOD install httpd-devel
elif [ $DISTRO == "debian" ]; then
apt-get install $APTMOD zlib1g-dev
apt-get install $APTMOD 'g++-3.4'
apt-get install $APTMOD libmysqlclient14-dev
apt-get install $APTMOD libreadline5-dev
apt-get install $APTMOD libwmf-bin
apt-get install $APTMOD libmysqlclient15-dev
apt-get install $APTMOD libssl-dev
apt-get install $APTMOD apache2-prefork-dev
fi
}
##
# install ImageMagik
function installimagemagik() {
download ImageMagick 6.4.3 http://downloads.rimuhosting.com/ImageMagick-6.4.3.tar.gz
echolog Installing ImageMagick VERSION=6.4.3
if [ $? -ne 0 ]; then echolog "failed downloading imagemagick" >&2; return 1; fi
./configure && make && make install
if [ $? -ne 0 ]; then
echolog "ImageMagick make install failed">&2
return 1
fi
}
##
# install ruby & dev libraries
function installruby() {
download ruby $RUBY_VERSION http://downloads.rimuhosting.com/ruby-$RUBY_VERSION.tar.gz
echolog Installing Ruby VERSION=$RUBY_VERSION
if [ $? -ne 0 ]; then echolog "failed downloading ruby" >&2; return 1; fi
./configure && make && make test && make install
if [ $? -ne 0 ]; then
echolog "Ruby make install failed">&2
return 1
fi
# so there'll be a /usr/bin/ruby to use
if [ -e /usr/local/bin/ruby -a ! -e /usr/bin/ruby ]; then
ln -sf /usr/local/bin/ruby /usr/bin/ruby
fi
# doing this voodoo to prevent errors like:
# /usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require’: no such file to load—readline (LoadError)
cd /usr/local/src/ruby-$RUBY_VERSION/ext/readline
if [ $? -ne 0 ]; then echolog "no /usr/local/src/ruby-$VERSION_ACTUAL/ext/readline dir">&2;return 1;fi
ruby extconf.rb
if [ $? -ne 0 ]; then echolog "readline extconf.rb failed">&2;return 1;fi
make clean && make install
if [ $? -ne 0 ]; then echolog "readline make failed">&2;return 1;fi
}
##
# install ruby gem
function installrubygems() {
download rubygems $RUBY_GEM_VERSION http://downloads.rimuhosting.com/rubygems-$RUBY_GEM_VERSION.tgz
echolog Installing Ruby Gems VERSION=$RUBY_GEM_VERSION
if [ $? -ne 0 ]; then echolog "failed downloading rubygems" >&2; return 1; fi
ruby setup.rb
if [ $? -ne 0 ]; then
echolog "Rubygems install failed">&2
return 1
fi
}
##
# install commonly used gems
function installcommongems() {
echolog Installing commonly used Ruby Gems
GEM_LIST="rails mongrel mongrel_cluster capistrano rmagick ruby-openid sqlite3-ruby mysql icalendar BlueCloth"
for gem in $GEM_LIST; do
gem install --include-dependencies $gem;
if [ $? -ne 0 ]; then
echolog "failed to install gem '$gem'"
fi
done
#install mysql gem is sometimes trouble (centos), installing it individually
if [ $DISTRO == "redhat" ]; then
gem install mysql -- --with-mysql-config=/usr/bin/mysql_config
elif [ $DISTRO == "debian" ]; then
gem install mysql
fi
#install mod_rails
gem install passenger --include-dependencies -v $MOD_RAILS_VERSION
#compile mod_rails apache module
#passenger-install-apache2-module
}
##
# create deployment environment
function createdeployenv() {
echolog Configuring mod_rails/Apache
#create app deployment directory w/correct permissions
mkdir $RAILS_APP_DEPLOYMENT_DIR
#remove apache default vhost / welcome screen
if [ $DISTRO == "redhat" ]; then
mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.conf.bak
elif [ $DISTRO == "debian" ]; then
rm /etc/apache2/sites-enabled/000-default
fi
#add basic passenger config
echo "LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-$MOD_RAILS_VERSION/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-$MOD_RAILS_VERSION
PassengerRuby /usr/local/bin/ruby
RailsEnv production
#Tune these to suit your application
PassengerMaxPoolSize 2
PassengerMaxInstancesPerApp 2
PassengerPoolIdleTime 600" > $MOD_RAILS_CONFIG
#create test rails app
cd $RAILS_APP_DEPLOYMENT_DIR
rails testapp
#create virtual host for test rails app
echo "<VirtualHost *:80>
DocumentRoot ${RAILS_APP_DEPLOYMENT_DIR}/testapp/public
</VirtualHost>" > $RAILS_APP_CONFIG
#restart apache
if [ $DISTRO == "redhat" ]; then
/etc/init.d/httpd restart
elif [ $DISTRO == "debian" ]; then
/etc/init.d/apache2 restart
fi
}
####################
# EXECUTION #
####################
aptgetupdate
aptgetmysf
installprereqpackages
installimagemagik
installruby
installrubygems
installcommongems
#createdeployenv
exit 0
发表评论
-
Rails 3 Beta版本月将出 Merb融合带来选择
2010-01-11 09:48 1419Rails 3,目前流行Web开发框架Rails的一个升级版 ... -
MerbAdmin:Merb数据管理好帮手
2010-01-11 09:43 907Merb中要加入类似Django的Admin功能早有传闻,如今 ... -
rails cms
2009-12-28 20:29 1669Rails CMS alternatives ======= ... -
Generating Thousands of PDFs on EC2 with Ruby
2009-12-24 18:01 1038The Problem For about two mont ... -
Shrink your JavaScript with the Google Compiler Rails Plugin
2009-11-16 11:27 933Like it or not, JavaScript has ... -
Thank you, Rails
2009-11-06 18:21 567It’s fashionable, or perhaps in ... -
Top 50 Ruby on Rails Websites
2009-10-31 15:18 944We’re big fans of Ruby on Rails ... -
Let a human test your app, not (just) unit tests
2009-10-31 09:26 853I’m a big believer in unit test ... -
Heroku Gets Add-Ons: Serious Ruby Webapp Hosting Made Easy
2009-10-30 07:37 913Heroku is a Ruby webapp hosti ... -
Rails + Google Analytics = easy goal tracking
2009-10-29 20:38 892Google Analytics is an indis ... -
Integrating Flickr into your rails website
2009-10-29 20:37 1067In this post I’m going to show ... -
Ruby on Rails Roadshow in Austin Thursday
2009-10-29 14:25 809Justin Britten founded Prefine ... -
Ruby on Rails and the importance of being stupid
2009-10-21 08:13 806A tale of two servers… Server ... -
How a 1-Engineer Rails Site Scaled to 10 Million Requests Per Day
2009-10-20 14:49 775Ravelry is an online knitting ... -
Installing Rails on CentOS 5
2009-10-20 14:24 1191Note: Since this post origina ... -
CentOS配置lighttpd和rails
2009-10-20 14:22 1123lighttpd版本:1.4.18 fastcgi版本: ... -
Cells:将组件开发带入Ruby2.3
2009-10-20 09:17 1118cells "将使得面向组 ... -
High Quality Ruby on Rails Example Applications
2009-10-15 16:34 1461Sometimes to best way to get ... -
Install Passenger on Ubuntu
2009-10-07 10:17 806Phusion Passenger is one of the ... -
Installing Ruby on Rails with Apache on Ubuntu 9.04 (Jaunty)
2009-10-07 10:00 1015Installing Passenger and Depe ...
相关推荐
### Ubuntu 11.04下Ruby on Rails与MySQL数据库集成指南 #### 一、安装与配置MySQL数据库 在Ubuntu 11.04环境中,安装MySQL数据库是部署Ruby on Rails应用的重要步骤之一。首先,通过打开终端并执行以下命令进行...
在本文中,我们将深入探讨如何在Linux系统上配置一套高性能的Web开发环境,即Nginx、Ruby on Rails和MySQL的集成。这个配置方案被广泛推荐,特别是对于需要高效能和稳定性的Web应用。 首先,我们来安装RVM(Ruby ...
### 快速安装Ruby on Rails的简明指南 #### 知识点概览 - **基础知识**:了解Ruby on Rails框架及其重要性。 - **系统准备**:选择合适的操作系统进行安装。 - **基础软件安装**:包括Xcode、Homebrew等必备工具。 ...
在进行 Ruby on Rails 的安装与部署过程中,我们需要关注几个核心方面:系统版本兼容性、软件依赖包的选择与安装、Ruby 语言环境的配置以及 Rails 应用的具体部署步骤。本手册将详细介绍这些方面的内容,并提供具体...
总之,`rails-development-environment`项目提供了一个强大而易用的工具集,让开发者能够在统一的、基于Ubuntu的环境中高效地进行Ruby on Rails开发。通过Vagrant和VirtualBox的结合,它实现了跨平台的可移植性,而...
在Linux系统上安装Ruby on Rails和Lighttpd是一项常见的任务,尤其对于开发者来说,搭建这样的环境是构建Web应用的基础。Ruby on Rails是一个基于Ruby语言的开源Web开发框架,而Lighttpd则是一款轻量级的HTTP服务器...
Ruby on Rails(简称Rails)是基于Ruby构建的一个开源Web应用框架,它遵循MVC(模型-视图-控制器)架构模式,使得开发过程高效且易于维护。 在开始搭建Ruby和Rails的开发环境之前,你需要确保你的系统满足必要的...
您可能需要按照以下步骤将 ruby on rails 应用程序部署到 Ubuntu + Nginx + Unicorn 环境。 在这里,我将 RVM 安装为多用户模式。 我使用www-data用户来运行我的应用程序(这是 Ubuntu 上 Apache 和 Nginx 的...
对于使用Ubuntu的Ruby on Rails开发人员的一些有用的脚本/好东西! 1. Rails安装程序 为了在Ubuntu 12.04 LTS(精确的穿山甲)/ 12.10(定量Quetzal)上设置Rails,我还为初学者编写了逐步指南,请阅读博客文章 2....
在Ubuntu服务器上搭建Rails生产环境是一项关键的任务,它涉及到多个步骤和组件的配置。Rails是Ruby的一个框架,用于构建Web应用程序。在这个过程中,我们将主要关注以下几个核心知识点: 1. **Ruby 安装**:首先,...
在Ruby on Rails(RoR)框架中创建第一个应用程序是一个学习和熟悉这个强大的Web开发工具的重要步骤。本教程将深入探讨如何使用RoR构建一个简单的Web应用程序,名为"first_app"。RoR是基于Ruby语言的一个开源框架,...
Ruby是一种强大的、面向对象的脚本语言,尤其适合Web开发,如使用Rails框架。在Ubuntu操作系统上安装Ruby,可以让你利用其丰富的库和工具来构建高效的应用程序。本指南将详细讲解如何在Ubuntu系统上安装Ruby 2.1.5这...
本文档主要介绍了如何在Ubuntu操作系统中使用RVM配置Ruby on Rails开发环境。具体包括两种常见的配置方案: 1. **Ruby 1.8.7 + Rails 2.3.5** 2. **Ruby 1.9.2 + Rails 3.0.3** #### 三、配置步骤详解 1. **安装...
你可以开始使用它进行开发工作,或者通过`gem`命令安装所需的Ruby库和框架,如Ruby on Rails。 在Ruby开发中,`gem`是包管理器,用于安装、管理和更新Ruby库。例如,要安装Rails框架,只需运行: ```bash gem ...
标题 "rails2.3.3" 指的是Ruby on Rails框架的一个特定版本,即2.3.3。Ruby on Rails(简称Rails)是一个开源的Web应用框架,它基于Ruby编程语言,遵循MVC(模型-视图-控制器)架构模式,旨在提高开发效率和代码的...
Ruby是一种动态、面向对象的脚本语言,常被用于Web开发。对于开发者而言,掌握Ruby的安装与配置至关重要。Ubuntu用户通常会依赖于包管理工具`apt-get`来安装Ruby,这种方式虽然简单便捷,但在某些情况下可能无法满足...
在IT行业中,构建一个开发环境是每个程序员的必备技能,特别是对于使用Ruby on Rails框架的开发者来说。本篇文档详细介绍了在不同的操作系统环境下,如何正确安装Ruby、Rails及其依赖环境。 首先,对于操作系统的...