Linux Deploy Rails3 with Ruby1.9.2(3)

LinuxDeployRails3withRuby1.9.2(3)

Iwillnotgiveupthis.Isolvedtheproblembellow:

curl:(60)SSLcertificateproblem,verifythattheCAcertisOK.Details:

error:14090086:SSLroutines:SSL3_GET_SERVER_CERTIFICATE:certificateverifyfailed

Ifindanewwaytotry.Ifollowcurl-ktoinstallruby1.9.2viarvm.

wewillmake-ktoeverycurltofixthe

>vi~/.rvm/scripts/fetch

add-koptionparameteraftereverycurl.

1.Installruby1.9.2

>sudorvminstall1.9.2

>sudorvm--defaultruby-1.9.2-p290

>ruby-v

ruby1.9.2p290(2011-07-09revision32553)[i686-linux]

>whichruby

~/.rvm/rubies/ruby-1.9.2-p290/bin/ruby

2.Installrails

>sudogeminstallrails--pre--no-ri--no-rdoc-v=3.1.0.rc5

>rails-v

Rails3.1.0.rc5

>whichrails

~/.rvm/gems/ruby-1.9.2-p290/bin/rails

3.Installpassengerandsqlite3

>sudogeminstall-Vpassenger

>sudogeminstallsqlite3-ruby

errormessage:

ERROR:Errorinstallingsqlite3-ruby:

ERROR:Failedtobuildgemnativeextension.

solutions:

>wgethttp://www.sqlite.org/sqlite-autoconf-3070400.tar.gz

or

>wgethttp://www.sqlite.org/sqlite-amalgamation-3.7.2.tar.gz

>tarzxvfsqlite-autoconf-3070400.tar.gz

>cdsqlite-autoconf-3070400

>./configure--disable-shared--enable-static--prefix=/usr/sqlite3

>sudomkdir/usr/sqlite3

>make

>sudomakeinstall

>sqlite3-version

3.7.4

>sudocpsqlite3/usr/bin/sqlite3

>whichsqlite3

/usr/bin/sqlite3

>sudogeminstallsqlite3-ruby----with-sqlite3-dir=/usr/sqlite3

great,itisdone.

4.trytostarttherails

>railss

errormessages:

`autodetect':CouldnotfindaJavaScriptruntime.

solutions:

Trytoinstallnodejsontheserverside,thisisthejavascriptserversidejavascript.

>wgethttp://nodejs.org/dist/node-v0.4.8.tar.gz

or

>wgethttp://nodejs.org/dist/node-v0.5.0.tar.gz

>tarzxvfnode-v0.4.8.tar.gz

>cdnode-v0.4.8

>./configure--prefix=/usr/nodejs

errormessageduringconfiguretime:

raceback(mostrecentcalllast):

File"/home/luohua/tmp/node-v0.4.8/tools/waf-light",line157,in?

importScripting

File"/home/luohua/tmp/node-v0.4.8/tools/wafadmin/Scripting.py",line9,in?

importUtils,Configure,Build,Logs,Options,Environment,Task

File"/home/luohua/tmp/node-v0.4.8/tools/wafadmin/Build.py",line18,in?

solutions:

Itissaidthatmypythonversionistooold,Ineedtoupdateit.

>python-V

Python2.3.4

Thatisthetruth.Myversionofpythonis2.3.Iwillupgradepython2.3.4topython2.6.1.

>wgethttp://www.python.org/ftp/python/2.6.1/Python-2.6.1.tar.bz2

>tar-jxvfPython-2.6.1.tar.bz2

>cdPython-2.6.1

>./configure--prefix=/usr/python2.6.1

>sudomkdir/usr/python2.6.1

>make

>sudomakeinstall

>sudomv/usr/bin/python/usr/bin/python2.3.4

>sudoln-s/usr/python2.6.1/bin/python/usr/bin/python

>python-V

Python2.6.1

Itisgreat,nothinggowrong.Iwillgoonmynodejsinstallation.

>./configure--prefix=/usr/nodejs

>sudomkdir/usr/nodejs

>make

errormessage:

Buildfailed:->taskfailed(err#2):

{task:libv8.aSConstruct->libv8.a}

make:***[program]Error1

sulotions:

compileandinstallv8,firstofall,downloadandinstallSVNclientonmysystem.

InstallSVNClient

DownloadthefilefromthisURL

http://www.open.collab.net/files/documents/60/4612/CollabNetSubversion-client-1.6.17-1.i386.rpm

>sudorpm-ivhCollabNetSubversion-client-1.6.17-1.i386.rpm

thesvninstallationplaceis/opt/CollabNet_Subversion/bin

weneedtolinkittothe/usr/bin

>sudoln-s/opt/CollabNet_Subversion/bin/svn/usr/bin/svn

>svn--version

svn,version1.6.17(r1128011)

svninstallationworkisdone,Iwillgoonwiththev8installation.

Installsconstool,

>wgethttp://prdownloads.sourceforge.net/scons/scons-2.1.0.alpha.20101125.tar.gz

>tarzxvfscons-2.1.0.alpha.20101125.tar.gz

>cdscons-2.1.0.alpha.20101125

>sudopythonsetup.pyinstall

>sudoln-s/usr/python2.6.1/bin/scons/usr/bin/scons

>scons-v

SConsbyStevenKnightetal.:

script:v2.1.0.alpha.20101125.r5183[MODIFIED],2010/11/2514:46:21,bybdeeganonubuntu

SConsisdone.

>svncheckouthttp://v8.googlecode.com/svn/trunk/v8

>cdv8

>scons

>sudocplibv8.a/usr/lib/libv8.a

>sudocplibv8preparser.a/usr/lib/libv8preparser.a

>sudocp-rinclude/*/usr/include/

>sudochmoda+xlibv8.a

>sudochmoda+xlibv8preparser.a

v8isdone,goonthenodejsthings.

>sudomakeclean

>sudomake

errormessages:

scons:***[obj/release/platform-linux.o]Error1

scons:buildingterminatedbecauseoferrors.

Waf:Leavingdirectory`/home/luohua/tmp/node-v0.4.8/build'

Buildfailed:->taskfailed(err#2):

{task:libv8.aSConstruct->libv8.a}

make:***[program]Error1

solutions:

changeto0.5.0version

Igotanothererrormessage:

ev/ev.c:389:26:error:sys/inotify.h:Nosuchfileordirectory

make[1]:***[ev/ev.o]Error1

make[1]:Leavingdirectory`/home/luohua/node-v0.5.0/build/default/deps/uv'

Waf:Leavingdirectory`/home/luohua/node-v0.5.0/build'

Buildfailed:->taskfailed(err#2):

{task:uvuv.h->uv.a}

make:***[program]Error1

copytheafilestoournodejs0.4.8libdirectory

>sudocp/usr/lib/libv8.alib/libv8.a

>sudocp/usr/lib/libv8preparser.alib/libv8preparser.a

Notworking.

trycopinglibv8andlibv8preparserto/usr/local/lib

>sudocplibv8*/usr/local/lib/

>sudochmoda+x/usr/local/lib/libv8.a

>sudochmoda+x/usr/local/lib/libv8preparser.a

>./configure\

--prefix=/usr/nodejs\

--shared-v8\

--shared-v8-includes=/home/luohua/v8/include\

--shared-v8-libpath=/usr/local/lib\

--shared-v8-libname=v8

>sudomake

errormessage:

Buildfailed:->taskfailed(err#1):

{task:cxxplatform_linux.cc->platform_linux_3.o}

make:***[program]Error1

solutions:

commentingoutthe"PR_SET_NAME"lineinsrc/platform_linux.cc

prctl(PR_SET_NAME,process_title);deletingthisline

>sudomakeclean

>sudomake

errormessages:

../src/node_crypto.cc:2917:error:'SSL_COMP_get_compression_methods'wasnotdeclaredinthisscope

Waf:Leavingdirectory`/home/luohua/tmp/node-v0.4.8/build'

Buildfailed:->taskfailed(err#1):

{task:cxxnode_crypto.cc->node_crypto_3.o}

make:***[program]Error1

solutions:

compileandinstallopenssl

>wgethttp://www.openssl.org/source/openssl-1.0.0d.tar.gz

>tarzxvfopenssl-1.0.0d.tar.gz

>./Configure

>sudomake

>sudomkdir/usr/openssl

>sudomakeinstall

opensslinstallsuccess,goon.

>./configure\

--prefix=/usr/nodejs\

--shared-v8\

--shared-v8-includes=/home/luohua/v8/include\

--shared-v8-libpath=/usr/local/lib\

--shared-v8-libname=v8--openssl-includes=/usr/local--openssl-libpath=/usr/local

thissolutionisnotworkforme.Tryinganotherwaywithoutssl.

>./configure\

--prefix=/usr/nodejs\

--shared-v8\

--shared-v8-includes=/home/luohua/v8/include\

--shared-v8-libpath=/usr/local/lib\

--shared-v8-libname=v8--without-ssl

>sudomake

>sudomakeinstall

>sudoln-s/usr/nodejs/bin/node/usr/bin/node

>node--version

v0.4.8

>cdmy_project_location

>sudormGemfile.lock

>bundleinstall

>sudorailss

Itisfuckinggreat.Therailsserverrunsuccessfullyonredhatnow.

references:

http://hi.baidu.com/beyond_javy/blog/item/986fee1f4f8bfa1d314e15f6.html

http://anylinux.info/?p=116

http://www.scons.org/doc/1.0.1/HTML/scons-user/x124.html

http://superuser.com/questions/262385/getting-node-js-0-4-2-to-build-install-on-freebsd-8-2-amd64

http://pasobellatech.posterous.com/installing-nodejs-alongside-django-on-macbook

http://stackoverflow.com/questions/6118711/error-install-nodejs-ssl-comp-get-compression-methods

http://nelsonslog.wordpress.com/2011/04/10/node-without-ssl/