Upgrade to rails3 + ruby1.9.2 the various problems encountered in the process
Advertisements
An upgrade to 1.9.2 ruby1.8.7
First, download the ruby-1.9.2
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p0.tar.gz tar -zxvf ruby-1.9.2-p0.tar.gz cd ruby-1.9.2-p0 .configure -prefix=/usr/local/ruby # Specify the installation path make make test make install # Compile and install sudo ln -s /usr/local/ruby/bin/ruby /usr/bin/ruby # Create a soft link
All goes well, but do not know Zehui Shi, seemingly engaged in gem yesterday when, again get back to 1.8 again today, restart the computer, or 1.8,1.9 also a mess, and the decision over again So, modify all the steps to remove the usr / local / ruby remove usr / bin / ruby under all
Re the above steps (ln piece orders excluded)
Last changed my environment variable path edit the file etc / environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ruby/bin"
Modification is completed, reboot the system, buttoned
ruby -v ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
ruby installation is complete
Second, the escalation of GEM
Run the gem command, an error message: Error ruby1.8.7 dependent, this is the reason that previous residue / usr / bin under a series of gem gem1.8 gem × × of the class of all get rid of
After the installation ruby1.9.2 gem is already installed as above set path, gem in the usr / local / ruby / bin directory, so remove those residues can still run after gem
gem -v 1.3.7
However, running gem list
Error
ERROR: Loading command: list (LoadError)
no such file to load -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::ListCommand
Search, I: (http://javaeye.shaduwang.com/?www/topic/743850), said that the lack of zlib
(1)sudo apt-get install zlib1g-dev (2) And then to the source directory under the ext/zlib ( Just unzip the ruby1.9.2 directory ) (3)ruby extconf.rb ( Needs administrator rights ) (4)make (5)sudo make install
This can be run gem list
gem install × × can run
Additional information:
Although the path set path environment variable, or to establish what soft links, otherwise the implementation of sudo ruby or sudo gem will still error when:
sudo: ruby: command not found
So also the establishment of the following soft links
sudo ln -s /usr/local/ruby/bin/ruby /usr/bin/ruby sudo ln -s /usr/local/ruby/bin/gem /usr/bin/gem
Then run sudo gem-v 1.3.7 Output
Third, install rails3
Running rails-v
bash: / usr / bin / rails: / usr/bin/ruby1.8: damage to the interpreter: No file or directory
find a moment rails find / usr/lib/ruby/gems/1.8 directory underneath rails file
/ Usr / bin / rails is called when running rails
Delete all
Implementation of the command gem install rails to install rails
After installation is complete run rails-v no problem but sudo rails-v command on the back with the above tips do not have this same reason: sudo ln-s / usr / local / ruby / bin / rails / usr / bin / rails
sudo rails-v has no problem
4 Other issues
Open yesterday's rails3 + ruby1.8 projects, rake test error of some gem update first, resulting in the version number does not correspond to, later amended, rake test
Error: Errors running test: units!
Do not know what wrong
Run separately
rake test:units !!! Missing the mysql gem. Add it to your Gemfile: gem 'mysql', '2.8.1'are seen under the gem list, found this gem not installed mysql
So the gem install mysql
sudo gem install mysql
Error, the stack exception as follows:
------------------------------------------
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/local/ruby/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/ruby/bin/ruby
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mygcclib
--without-mygcclib
--with-mysqlclientlib
--without-mysqlclientlib
Gem files will remain installed in /usr/local/ruby/lib/ruby/gems/1.9.1/gems/mysql-2.8.1 for inspection.
Results logged to /usr/local/ruby/lib/ruby/gems/1.9.1/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
--------------------------------
The following result is not installed
apt-get install libmysqlclient-dev
Installed this, finally a gem install mysql
To run rake test
Wrong again
!!! Missing the mysql gem. Add it to your Gemfile: gem 'mysql', '2 .8.1 '
Look, forget the gem 'mysql', '2 .8.1 'words into Gemfile file
Finally ... ...
You can run rake test the
Related Posts of Upgrade to rails3 + ruby1.9.2 the various problems encountered in the process
-
Manual configuration in UBUNTU under ruby on rails environment
Careless mistake for the day before yesterday, the sources, the results after 810 error after the upgrade, the loss of response button. On google found a lot of trouble really, lucky point modification under the / etc/X11/xorg.conf to restore both, b ...
-
Getting Started Programming spring Ten Questions
1, how to study Spring? You can study through the following means spring: (1) spring package download doc directory under MVC-step-by-step and the sample directory are relatively good examples of spring development examples. (2) AppFuse integrates a numbe
-
About rails install mysql driver error problem
My local wamp server using one of the key package, only used mysql functions, today in the use of rake db: migrate when First reported a month can not be implemented, the next inquiry and found no mysql installed a gem, to install gem install mysql i ...
-
In the Linux platform to install and configure Ruby on Rails Detailed
ruby on rails recommend the production environment is running Linux / FreeBSD / Unix, or Unix family of operating systems, using lighttpd + FCGI solution. The following will be my Linux operating system, lighttpd + FCGI, MySQL database as an example, comp
-
org.hibernate.LazyInitalizationException
Error message: org.hibernate.LazyInitalizationException ..., no session or session was closed Analysis: When the statistics when the number of sub-classification, entity objects are already in session beyond the free state, Hibernate's transactio ...
-
Rails source code analysis (1): RailsFCGIHandler
In accordance with the sequence starting from the beginning CGI Ruby CGI Doc: The Common Gateway Interface ( CGI ) Is a simple protocol for passing an HTTP request from a web server to a standalone program, and returning the output to the web browser ...
-
Answer: After 2.2 upgrade mysql question-driven
windows installed after the mysql gem error, error is approximately: ArgumentError (NULL pointer given): (eval): 3: in `each_hash ' (eval): 3: in `all_hashes' This is feeling under the windows of the question if the mysql gem version libmysql ...
-
JPA data source data source to configure Tomcat conversion essay questions
To the JPA in the use of the development process, sometimes used in the data source conversion problem, The following methods are only my personal experience of a situation and its solutions, if different, please everyone posted for your reference encount
-
Hibernate II Study Notes
11. Many-to-many Of many that can be converted to two one-to-many <set name="students" table="teacher_student"> <key column="techer_id"/> <many-to-many column="student_id"/> </set> many-to-many data only from one end of the mainten
-
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












