Rails3 and Ruby1.9.2 on Ubuntu11.04

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

  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of Rails3 and Ruby1.9.2 on Ubuntu11.04

  • Hibernate configuration parameters hibernate.hbm2ddl.auto

    Hibernate in the configuration file: <properties> <property name="hibernate.hbm2ddl.auto" value="create" /> </ properties> Parameter Description: validate load hibernate, the authentication to create a database t ...

  • Build flex + spring + blazeds + hibernate application

    Build flex + spring + blazeds + hibernate application First, set up the project blazeds 1, will blazeds.war extract to a directory, such as: myflex /; 2, set up java works were such as: MyFlex, in the orientation of selection create project from exis ...

  • Hibernate connection pool configuration

    Hibernate connection pool configuration <! - Jdbc -> <property name="connection.driver_class"> oracle.jdbc.driver.OracleDriver </ property> <property name="connection.url"> jdbc: oracle: thin: @

  • In the servlet use Bean

    According to Sun's definition, JavaBean is a reusable software components. In fact JavaBean is a Java class, through the package into a property and methods of treatment of a function or a business object, referred to as bean. Because JavaBean is ...

  • hibernate generic generic DAO

    package org.lzpeng.dao; import java.io.Serializable; import java.util.List; import org.hibernate.Criteria; import org.hibernate.Query; import org.hibernate.criterion.Criterion; import org.springside.modules.orm.hibernate.Page; /** * * @version 2009-1-10 *

  • Struts2 + hibernate + spring problem user log in

    dao layer services layer action jsp <tr> <td align="center"> <b> user name: </ b> </ td> <td> <s: textfield name = "czyNumber" cssClass = "textstyle" theme = "simple" size = &q

  • Hibernate secondary cache

    Hibernate cache: 2-bit cache, also known as process-level cache or SessionFactory level cache, secondary cache can be shared by all of the session Cache configuration and the use of: Will echcache.xml (the document code in hibernate package directory ...

  • Hibernate's lazy strategy

    hibernate Lazy strategy can be used in: <class> tag, it can be true / false Tags can <PROPERTY> values true / false type of necessary tools to enhance <set> <list> can tag values true / false / extra <many-to-one> <on ...

blog comments powered by Disqus
Recent Entries
Tag Cloud
Random Entries