- 浏览: 2539043 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Rails3 and Ruby1.9.2 on Ubuntu11.04
1. Install ruby1.9.2
>sudo apt-get install ruby1.9.2
>cd /usr/bin
>sudo ln -s ruby1.9.1 ruby
2. Install rvm
>bash < <( curl https://rvm.beginrescueend.com/releases/rvm-install-head )
>vi /home/carl/.bashrc
change from
#[ -z "$PS1" ] && return
to
if [[ -n "$PS1" ]]; then
add these statements at the last lines:
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi
fi
>source ~/.bashrc
check if the rvm is setup correctly.
>rvm notes
3. Install packages for ruby and rails
>sudo aptitude install build-essential bison openssl libreadline5 libreadline-dev curl git-core zlib1g zlib1g-dev libssl-dev vim libsqlite3-0 libsqlite3-dev sqlite3 libreadline-dev libxml2-dev subversion autoconf
I need to reinstall ruby here, because the last version installed by apt-get install ruby1.9.2 is not good maybe. I met a lot of problem when I install rails3.
>rvm install 1.9.2
set the ruby to default
>rvm --default ruby-1.9.2-p290
check the version of ruby
>ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
install rails
>sudo rm /usr/bin/gem
>sudo ln -s /usr/bin/gem1.9.1 /usr/bin/gem
>sudo gem install rdoc
>sudo gem install rails --pre --no-ri --no-rdoc
error messages:
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
solution:
>sudo apt-get install ruby-dev
error messages under /usr/lib/ruby/gems/1.9.1/gems/bcrypt-ruby-2.1.4/ext/mri :
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- mkmf (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from extconf.rb:13:in `<main>'
solution:
>sodu apt-get install ruby1.9.1-dev
great, it is work.
error messages:
>rails -v
/usr/local/lib/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rails (>= 0) amongst [daemon_controller-0.2.6, fastthread-1.0.7, passenger-3.0.8, rack-1.3.2, rake-0.9.2, rake-0.9.2] (Gem::LoadError)
from /usr/local/lib/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:1200:in `gem'
from /usr/bin/rails:18:in `<main>'
solutions:
>rvmsudo gem install rails --pre --no-ri --no-rdoc
>rails -v
Lucky, it is ok now.
install passenger
>gem install -V passenger
4. Runing the passenger standalone
go to the project directory and type
>passenger start
some error about the mysql, so I solve it in this way
>bundle update mysql
>bundle install
>passenger start
I think I do not need to use rvm to install all the software, what I am doing wrong is NOT installed ruby1.9.1-dev at the first. I think with ruby1.9.2 ruby1.9.1-dev and rails3, that will work fine.
error messages:
/home/carl/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.4/lib/execjs/runtimes.rb:45:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/carl/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.4/lib/execjs.rb:5:in `<module:ExecJS>'
solutions:
add these statements in Gemfile
>vi Gemfile
gem 'execjs'
gem 'therubyracer'
>bundle install
errror messages:
>bundle show lib8
Could not find libv8-3.3.10.2 in any of the sources
solutions:
>sudo gem install libv8
>vi Gemfile
gem 'libv8'
>bundle update
>bundle install
>rails server
It is ok now, for rails server webtrick applications.
>sudo gem install activesupport
>passenger start
It works fine now.
references:
http://www.christopherirish.com/2010/08/25/how-to-install-rvm-on-ubuntu-10-04/
http://thoughtrails.com/episodes/4-deployment-of-production-enviroment-ruby-1-9-2-rails-3-nginx-passenger-and-postgresql-with-rvm
http://armyofevilrobots.com/node/418
http://rubygems.org/gems/libv8
1. Install ruby1.9.2
>sudo apt-get install ruby1.9.2
>cd /usr/bin
>sudo ln -s ruby1.9.1 ruby
2. Install rvm
>bash < <( curl https://rvm.beginrescueend.com/releases/rvm-install-head )
>vi /home/carl/.bashrc
change from
#[ -z "$PS1" ] && return
to
if [[ -n "$PS1" ]]; then
add these statements at the last lines:
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi
fi
>source ~/.bashrc
check if the rvm is setup correctly.
>rvm notes
3. Install packages for ruby and rails
>sudo aptitude install build-essential bison openssl libreadline5 libreadline-dev curl git-core zlib1g zlib1g-dev libssl-dev vim libsqlite3-0 libsqlite3-dev sqlite3 libreadline-dev libxml2-dev subversion autoconf
I need to reinstall ruby here, because the last version installed by apt-get install ruby1.9.2 is not good maybe. I met a lot of problem when I install rails3.
>rvm install 1.9.2
set the ruby to default
>rvm --default ruby-1.9.2-p290
check the version of ruby
>ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
install rails
>sudo rm /usr/bin/gem
>sudo ln -s /usr/bin/gem1.9.1 /usr/bin/gem
>sudo gem install rdoc
>sudo gem install rails --pre --no-ri --no-rdoc
error messages:
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
solution:
>sudo apt-get install ruby-dev
error messages under /usr/lib/ruby/gems/1.9.1/gems/bcrypt-ruby-2.1.4/ext/mri :
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- mkmf (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from extconf.rb:13:in `<main>'
solution:
>sodu apt-get install ruby1.9.1-dev
great, it is work.
error messages:
>rails -v
/usr/local/lib/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rails (>= 0) amongst [daemon_controller-0.2.6, fastthread-1.0.7, passenger-3.0.8, rack-1.3.2, rake-0.9.2, rake-0.9.2] (Gem::LoadError)
from /usr/local/lib/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:1200:in `gem'
from /usr/bin/rails:18:in `<main>'
solutions:
>rvmsudo gem install rails --pre --no-ri --no-rdoc
>rails -v
Lucky, it is ok now.
install passenger
>gem install -V passenger
4. Runing the passenger standalone
go to the project directory and type
>passenger start
some error about the mysql, so I solve it in this way
>bundle update mysql
>bundle install
>passenger start
I think I do not need to use rvm to install all the software, what I am doing wrong is NOT installed ruby1.9.1-dev at the first. I think with ruby1.9.2 ruby1.9.1-dev and rails3, that will work fine.
error messages:
/home/carl/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.4/lib/execjs/runtimes.rb:45:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/carl/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.4/lib/execjs.rb:5:in `<module:ExecJS>'
solutions:
add these statements in Gemfile
>vi Gemfile
gem 'execjs'
gem 'therubyracer'
>bundle install
errror messages:
>bundle show lib8
Could not find libv8-3.3.10.2 in any of the sources
solutions:
>sudo gem install libv8
>vi Gemfile
gem 'libv8'
>bundle update
>bundle install
>rails server
It is ok now, for rails server webtrick applications.
>sudo gem install activesupport
>passenger start
It works fine now.
references:
http://www.christopherirish.com/2010/08/25/how-to-install-rvm-on-ubuntu-10-04/
http://thoughtrails.com/episodes/4-deployment-of-production-enviroment-ruby-1-9-2-rails-3-nginx-passenger-and-postgresql-with-rvm
http://armyofevilrobots.com/node/418
http://rubygems.org/gems/libv8
发表评论
-
Diskspace Check and Fix
2020-04-01 00:28 407Diskspace Check and Fix First ... -
Play Raspberry Pi(6)Upgrade and Docker
2016-06-17 00:27 476Play Raspberry Pi(6)Upgrade and ... -
VirtualBox Network
2015-06-10 11:48 770VirtualBox Network Last one ye ... -
Debian System(2)Debian Desktop
2015-04-02 03:51 727Debian System(2)Debian Desktop ... -
Debian System(1)Java and NodeJS Env
2015-03-29 06:27 1021Debian System(1)Java and NodeJS ... -
Play Raspberry Pi(3)Disable the logging on squid
2015-01-07 00:13 1130Play Raspberry Pi(3)Disable th ... -
Ubuntu Rebuild Environment(1)
2014-07-09 22:25 1307Ubuntu Rebuild Environment(1)Re ... -
Forget MySQL Root Password
2011-09-15 14:29 1548Forget MySQL Root Password 1. ... -
Rails Deployment(1)modrails
2011-08-17 13:44 1225Rails Deployment(1)modrails 1. ... -
Install Ubuntu on Win7 64 bit System
2011-07-19 23:56 1950Install Ubuntu on Win7 64 bit S ... -
Review Board on Ubuntu System(II)Script and Server configuration
2011-07-06 13:52 2538Review Board on Ubuntu System(I ... -
Review Board on Ubuntu System(I)Installing and create sites
2011-07-05 15:07 1687Review Board on Ubuntu System(I ... -
Problem in Wireshark on Ubuntu
2011-06-01 20:04 1713Problem in Wireshark on Ubuntu ... -
Install Anti-Virus Software on Ubuntu
2011-05-11 12:46 1637Install Anti-Virus Software on ... -
Update Ubuntu to 11.04
2011-05-05 13:11 1213Update Ubuntu to 11.04 After I ... -
Using Apache ProxyPass on Ubuntu
2011-04-22 14:31 1849Using Apache ProxyPass on Ubunt ... -
Udpate my ip on ubuntu system
2011-04-17 12:39 1320Udpate my ip on ubuntu system ... -
Ubuntu useful softwares
2011-04-12 22:57 1523Ubuntu useful softwares BT too ... -
Start the applications on Ubuntu
2011-04-12 14:11 1252Start the applications on Ubunt ... -
SVN command introduction
2011-03-31 23:50 1312SVN command introduction >s ...
相关推荐
### Ubuntu 11.04下Ruby on Rails与MySQL数据库集成指南 #### 一、安装与配置MySQL数据库 在Ubuntu 11.04环境中,安装MySQL数据库是部署Ruby on Rails应用的重要步骤之一。首先,通过打开终端并执行以下命令进行...
5. **Ruby开发和应用**: Ruby广泛应用于Web开发,尤其是搭配Rails框架。它也被用于系统自动化、脚本编写、数据分析等领域。1.9.2版本的更新意味着开发者可以利用新的语言特性和优化,提高代码效率和可维护性。 6. *...
### Ruby on Rails Guides v2 - Ruby on Rails 4.2.5 #### 一、重要概念及基础假设 - **重要概念**:本指南旨在帮助读者深入理解Ruby on Rails(以下简称Rails)4.2.5版本的核心功能与最佳实践。 - **基础假设**:...
学习Ruby on Rails 4.0的逐步指南。 它包括针对Ruby 2.0.0的基本教程,是为至少了解另一种编程语言并熟悉HTML的程序员编写的。
Ruby_on_Rails_rails.zip Ruby_on_Rails_rails.zip Ruby_on_Rails_rails.zip Ruby_on_Rails_rails.zipRuby_on_Rails_rails.zip Ruby_on_Rails_rails.zip Ruby_on_Rails_rails.zip Ruby_on_Rails_rails.zipRuby_on_...
《Ruby on Rails Tutorial》中文版(原书第2版,涵盖 Rails 4) Ruby 是一门很美的计算机语言,其设计原则就是“让编程人员快乐”。David Heinemeier Hansson 就是看重了这一点,才在开发 Rails 框架时选择了 Ruby...
综上所述,"Ruby on Rails 3"结合Ruby 1.9.2的特性,为开发者提供了一个强大且高效的Web开发平台,推动了Web应用的创新和发展。通过学习上述知识点,开发者可以更好地利用Rails 3构建高性能、易于维护的Web应用程序...
《Ruby on Rails 3 Tutorial》是一本专门为初学者设计的指南,旨在帮助读者快速掌握Ruby on Rails这一强大的Web开发框架。Ruby on Rails(简称Rails)是基于Ruby语言的一个开源框架,它采用MVC(Model-View-...
Ruby on Rails,简称Rails,是基于Ruby编程语言的一个开源Web应用程序框架,它遵循MVC(模型-视图-控制器)架构模式,旨在提高开发效率和代码的可读性。Rails以其“约定优于配置”(Convention over Configuration)...
9. **Install Ruby Rails Lighttpd MySQL on Ubuntu or FreeBSD - Huihoo Wiki - Open Source Wiki_files**: 这可能是上述文档的辅助文件,可能包含图片或其他资源,有助于理解安装过程。 安装Ruby on Rails的过程...
### Ruby on Rails 101:深入理解与实践 #### 引言 《Ruby on Rails 101》是一本介绍Ruby on Rails(简称RoR或ROR)的基础书籍,旨在为初学者提供一个全面而深入的学习框架。本书由Peter Marklund编写,包含了五天...
RUBY的经典之作,对其在RAILS下开发写得很详细
Ruby on Rails,简称Rails,是由David Heinemeier Hansson创建的一个开源Web应用程序框架,它基于Ruby编程语言。这个框架以其MVC(Model-View-Controller)架构、约定优于配置(Convention over Configuration)的...
Ruby on Rails,简称Rails,是基于Ruby语言的开源Web应用框架,它遵循MVC(Model-View-Controller)架构模式,旨在使开发过程更加简洁高效。这个“ruby on rails 教程源码”很可能是为了辅助学习者深入理解Rails的...
本书教您如何使用Ruby on Rails开发和部署真正的,具有工业实力的Web应用程序,Ruby on Rails是为诸如Twitter,Hulu,GitHub和Yellow Pages等顶级网站提供支持的开源Web框架。