ROR environmental configuration (rails2.2.2 fell from 1.2.6)

sponsored links
ROR environment structures put my steps down - Memo

2009.1.26



ROR online to find some tutorials are ruby 1.8.5, rails1.2.6 to do based on the demonstration

I use the version downloaded from the Internet are the latest version at the installation encountered some problems, are now recorded.

OS: Win XP

One-Click Installer version 1.8.6 -27 (ruby)

Well-being in early MYsql5.0.18, security at the D: \ MySQL \ MySQL Server 5.0 \ bin \ Internet Say, the path has spaces may be wrong, did not control him.



1: the latest version of the One-Click Ruby Installer for Windows can http://rubyforge.org/frs/?group_id=167 Download

Installed after the windows at the CMD window run command ruby-v show version is 1.8.6.

Gem install and hook on to, to be a manager. Run gem-v shows 1.3.1

2: gem install rails-remote
This Order is explicit from the remote server is installed on rails, you can also run gem install rails to install, gem will be installed to determine whether the local rails, thereby to determine whether remote installation from the rails.

Run rails-v show version is 2.2.2

Can also run gem list - local to see what packages are installed,

Similar to the following path to see something. The package files are rails with ruby installed in the same directory.
C: \ ruby \ lib \ ruby \ gems \ 1.8 \ gems

And at C: \ ruby \ bin under rails.cmd add a document.

3: I put the project on the E: \ rails \ below, the name of pic, to enter the E: \ rails \

rails pic-d mysql

rails2.0 the default database is sqlite3, and rails1.2.6 the default database is mysql, and I have mysql database,
Set up the project with: rails projectname-d mysql

4: revise my WEB projects under E: \ rails \ pic \ config \ database.yml For example:

development:
adapter: mysql
encoding: utf8
database: here is my database name pool: 5
username: root
password: 1234
host: localhost

5: Entering E: \ rails \ pic \, enter the ruby script \ server, start the WEB server: WEBrick

Want to stop the web server with ctrl + c keys, you can.

6: Open IE, enter the http://127.0.0.1:3000 Click on About your application's environment error

7: online gogle one pass, an a: gem install sqlite3-ruby - version = 1.2.3, not effective

8: another google one pass, an a gem install mysql, open IE click on About your application's environment is also an error, but the error is different, that it can not find libmySQL.dll, one search at the local hard disk 5 libmySQL.dll available to the system appears moment I do not know which is correct

With the election of the first, copy to c: \ ruby \ bin, on the OK, and finally see the configuration.

9: Entering E: \ rails \ pic>, run ruby script \ generate model sy_user, sy_user me are the table name. There are data

10: Run ruby script \ generate controller sy_user

11: amend the E: \ rails \ pic \ app \ controllers \ sy_user_controller.rb, in the middle add scaffold: sy_user,

scaffold: sy_user - this is your only required to write the code, it generates a database table corresponding to CRUD operations, but also exciting is that it generates the corresponding view template file.

class SyUserController < ApplicationController
	scaffold:sy_user
end


12: Entering the http://127.0.0.1:3000/sy_user/new The following error

NoMethodError in Sy userController # new

undefined method `scaffold' for SyUserController:Class



Google pass one another, said yes to an Scaffolding plug-ins. TMD many things really. ...... No get



13: Finally decided to uninstall rails2.2.2, Simon had 1.2.6, I bought the book is the sense of 1.2.6

Uninstall: gem uninstall rails

Install the old version: gem install rails-v 1.2.6 a few minutes, etc., are installed online.

14: Re-implementation of Step 5, start the web server, a number of normal.

15: Another step-by-step implementation of 9,10,11.



16: Start Web server, enter http://127.0.0.1:3000/sy_user/new That can not find sy_users table, table name behind many an "s", then google one pass, saying that Rails is always assumed that the table name plural. I have also established a new sy_users table,

Table one more S. Enter http://127.0.0.1:3000/sy_user/new OK, successful, at least to see a set of CURD.

17: first engage in ROR, download at official online are the latest version, did not get, but to lower version.

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

Related Posts of ROR environmental configuration (rails2.2.2 fell from 1.2.6)

  • Workspace run under different Eclipse

    Now do live more and more often required to use eclipse in java and ruby & rails project conducted between the tangential shear from the past, because in the rails project used a coloring Aptana preferences, the results open the java project sour ...

  • Struts2 Spring Hibernate integration of easy

    1. Add Spring 2.0 in Libraries Choose the following four jar, and configure the / WEB-INF/lib under Spring2.0 AOP Libraries Spring2.0 Core Libraries Spring2.0 Persistence Core Libraries Spring2.0 WEb Libraries At the same time, the applicationContext ...

  • EJB ant script to deploy template works

    <? xml version = "1.0" encoding = "UTF-8"?> <! - Name Project name basedir build.xml file directory -> <project name="HelloWorld" basedir="."> <! - Property variables -> <! - The sour ...

  • Struts2 Spring Hibernate's easy to integrate

    1. Add Spring 2.0 in Libraries Choose the following four jar, and configure the / WEB-INF/lib under Spring2.0 AOP Libraries Spring2.0 Core Libraries Spring2.0 Persistence Core Libraries Spring2.0 WEb Libraries At the same time, the applicationContext ...

  • FLEX: integrating Spring + Hibernate

    Before a friend also wanted to study development of FLEX. Asked me to help him to be a small sample. Spent a weekend time, to integrate a sampleproject. Client: FLEX Server: Spring2.5 + Hibernate3.2 + Hibernate-annotations3.3.1 + MySQL5 FDS: BlazeDS3 IDE:

  • Memo hibernate problem

    hibernate using myeclipse automatically generated HBM mapping file will be schema ="***" catalog ="***" Separately are the database instance name and database name, but in fact has been stated jdbc url connection database, are the ...

  • Oracle instant clent for ruby / rails on cygwin

    Environment: XP: oracle full client, ruby, rails, gem cygwin: ruby rails, gem (the version with the XP version) Needs: for cygwin is installed under the rails platform support oci Steps: <1> download oracle instant client (10.2.0.3 Instant Client Pa

  • myeclipse plugin

    myeclipsePlug-ins? 1.tomcatPlugin(Start tomcat ):http ://www.sysdeo.com/eclipse/tomcatPlugin.html,2.xVersions of eclipse 3 version 2 .1Version doesn't work. 2.Lomboz(Development of jsp program ,jspDynamic prompt, debugging ):http://forge.objectweb.org/pro

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries