Rails3 and Ruby1.9.2 on Ubuntu11.04

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


if [[-n "$ PS1"]]; then

add these statements at the last lines:
if [[-s "$ HOME / .rvm / scripts / rvm"]]; then source "$ HOME / .rvm / scripts / rvm"; 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.
> 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> '
> 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> '
> 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> '
add these statements in Gemfile
> Vi Gemfile
gem 'execjs'
gem 'therubyracer'
> Bundle install

errror messages:
> Bundle show lib8
Could not find libv8- in any of the sources

> 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.


分类:OS 时间:2011-08-20 人气:150
blog comments powered by Disqus


  • E: Sub-process / usr / bin / dpkg returned an error code solutions 2011-01-27

    Sometimes, the use of sudo apt-get install may cause unexpected errors, especially the installation be interrupted, an error message is: Errors were encountered while processing: ttf-dustin khangman kdeedu kde E: Sub-process / usr / bin / dpkg return

  • 10 essential ruby gems 2009-03-20

    10 essential ruby gems Author:, source: yeeyan translation of words and the responsibility of Editor: Li Yu, 2008-02-14 11:02 At the time I programmed some things are necessary. So I summed up the 10 most important ruby gems list, they will make your

  • / Usr/bin/X11/xauth: error in locking authority file 2010-02-22

    / Usr/bin/X11/xauth: error in locking authority file If you started your ssh session with the X11 forwarding enabled but with the following message: / Usr/bin/X11/xauth: error in locking authority file ... There is a chance the. Xauthority in your ho

  • sudo install error / usr / bin / ld: cannot find-lpam 2010-05-10

    centos 5.1 version Quote [Root @ rztest sudo-1.7.2p6] # uname-a Linux rztest 2.6.18-53.el5 # 1 SMP Mon Nov 12 02:22:48 EST 2007 i686 i686 i386 GNU / Linux sudo compiled version of sudo-1.7.2p6 package Reported the following error Quote # Make install

  • Mac environment variable for ruby / gems etc 2010-11-03

    / Etc / profile Add following info at the end: PATH = "/ usr/local/lib/ruby/gems/1.8: / usr / local / bin: / Users/twer/.gem/ruby/1.8/bin: $ PATH"

  • Php compile error: / usr / bin / ld: cannot find-liconv solution 2011-05-16

    Install php in the process of compiling, ] #. / Configure Without error, can too, but in the implementation of ] # Make ZEND_EXTRA_LIBS = '-liconv' When error / Usr / bin / ld: cannot find-liconv make: *** [sapi / fpm / php-fpm] First check whether l

  • Sub-process / usr / bin / dpkg returned an error code (1) solution 2011-05-23

    Sub-process / usr / bin / dpkg returned an error code (1) solution Original Address: http://linux.deepin.org/node/87 cd /var/lib/dpkg sudo mv info{,.bak} sudo mkdir info sudo dpkg --configure -a sudo apt-get install -f

  • Ruby Gems更换淘宝源方法 2013-12-18

    这篇文章主要介绍了Ruby Gems更换淘宝源方法,官方源有时不稳定,国内淘宝做了一个镜像,本文讲解更换成淘宝源的方法,需要的朋友可以参考下 最近由于要做课设,所以昨天装了个 Windows,感觉闲的没事干,就想装个 Ruby 玩玩. 官方的 Rubygems 源由于有些资源放在 Amazon S3 上面,所以有时会抽风,在 Linux 下我用 proxychains gem install xxx 实现了指定程序实行 Shadowsocks 代理,但是 Windows 下不方便全局代理,所以就

  • E: Sub-process /usr/bin/dpkg returned an error ... 2012-04-23

    今天在ubuntu11.10安装mysql遇到 E: Sub-process /usr/bin/dpkg returned an error code (1) 查了很多资料 但是最终执行了如下命令就好了 sudo apt-get -f install

  • E: Sub-process /usr/bin/dpkg returned an error cod 2014-04-23

    在用apt-get安装软件时出现了类似于 : install-info: No dir file specified; try --help for more information.dpkg:处理 gettext (--configure)时出错: 子进程 post-installation script 返回了错误号 1 在处理时有错误发生: findutils E: Sub-process /usr/bin/dpkg returned an error code (1) 办法如下: 1.$

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.119 (s). 12 q(s)