Rails2.0.2 change the default DB adpter

2009-03-01  来源:本站原创  分类:Ruby  人气:1238 

In Rails2.0.2
rails demo
...
...
MissingSourceFile in SayController # hello
no such file to load - sqlite3
RAILS_ROOT: / home / kenb / rails-projects / demo
...
...
Checked config / database.yml, adpter default is set become the sqlite3.
Check the rails a bit of help:
-d, - database = name Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite2/sqlite3).
Default: mysql
Should be the default seems to mysql, try several times, was set as the default sqlite3
Had no choice but to use-d parameter specifies the database adpter (rails-d mysql demo)

But the problem is in the radrails, and there can specify-d to find the place, but even the manual is also too cumbersome. (Many characters played 8...)
Can't , finally found the way to default renamed mysql:

ubuntu as an example:
Dir: / usr (var) / lib/ruby/gems/1.8/gems/rails-2.0.2/lib/rails_generator/generators/applications/app
File: app_generator.rb
Line: 11 default_options: db => (ENV [ "RAILS_DEFAULT_DATABASE"] | | "sqlite3"),
Change to: default_options: db => (ENV [ "RAILS_DEFAULT_DATABASE"] | | "mysql"),

Can finally once and for all the, huh, huh ... ...

相关文章
  • Rails2.0.2 change the default DB adpter 2009-03-01

    In Rails2.0.2 rails demo ... ... MissingSourceFile in SayController # hello no such file to load - sqlite3 RAILS_ROOT: / home / kenb / rails-projects / demo ... ... Checked config / database.yml, adpter default is set become the sqlite3. Check the ra

  • myeclipse 8.0 to change the default workspace 2010-03-23

    myeclipse 8.0 to change the default workspace: Modify MyEclipse8 installation directory \ configuration \ config.ini file, in this file to add or edit: osgi.instance.area.default = file \: / D \: / dev_root / projects / workspace (the designated work

  • And rails 2.0 with Swing - rails2.0 comprehensive Tutorial - Part I 2009-03-20

    About a rails 2.0 Introduction of the article, a total of two parts. Translate the following article from here, or new Translation not please everyone exhibitions. I am pleased to see my video tutorial rails2.0 widely accepted. More than 1500 people

  • Eclipse or MyEclipse to change the default new file encoding 2010-04-22

    eclipse: the window-preferences-General-ContentType to the right of the window, replaced by gbk can, utf-8 is required. myEclipse follows: window-preferences-myEclipse-files and editors-jsp inside encoding, change here for ISO10646/UTF-8. eclipse and

  • [Ubuntu-9.10] modify grub to change the default boot system 2010-04-21

    / Boot / grub / grub.conf or / boot / grub / menu.lst There is / etc directory of the corresponding documents, but in Ubuntu-9.10 below the specific document that is the way: / Boot / grub / grub.cfg As for the changes that set default = "x", me

  • Change the default comboBox 2010-08-08

    Some time ago to write the drop-down list to change the default value, and change the drop-down list, dynamically change the form of data. But the Internet is a lot of information, unfortunately could not find a reference value, and most were probabl

  • Ruby On Rails-2.0.2 source code analysis (1)-Rails Start 2010-11-09

    Preface This article is for Ruby On Rails 2.0.2 source code analysis, learning and research. The tools used NetBean 6.1 Beta, WEBRick, SciTE, ruby-debug-base (0.10.0), ruby-debug-ide (0.1.10). Ruby version is 1.8.6. How analysis should be summarized,

  • Learning Linux the way - to change the default boot operating system 2010-11-25

    Newly installed Linux, the system starts the default operating system is Linux, but that is still commonly used in windows, so let friends to help change, but not recorded, letting him to help change it back today, record shared below: # Vi / etc / g

  • Change Apache default port and the port to modify wordpress 2011-05-11

    Apache is installed, the installation directory in the conf folder, there will be a text document httpd.conf, which is Apache's configuration files for Apache command of the operation, Apache default port number for web services in this course inside

  • Linux Learning Path - to change the default boot operating system 2010-11-25

    Just installed Linux, the system starts the default operating system is Linux, but that is still commonly used in windows, so let friends to help change, but not recorded, letting him to help change it back today, to share the record: # Vi / etc / gr

  • ubuntu10.10 to change the default boot operating system 2011-02-16

    sudo gedit / boot / grub / grub.cfg Grub.cfg open this file, the file set default = "0" of 0 corresponds to want to change the default boot operating system serial number (starting from 0), then save. Which menuentry lists all the optional kerne

  • MySQL Change the default sort 2010-11-24

    MySQL Change the default sort An information distribution system, most recently released records to the front. List a user's most recent 10 articles, the usual practice to create a double index (username + posttime). Use the SQL statement: select * f

  • Oracle 10g listener to change the default port number is encrypted 2011-05-18

    oracle database security consists of two parts: 1 part os the security of 2 network security software for their own safety 2.oracle os security of the operating system rely on the appropriate level of technology and the administrators, we are here on

  • Java application to change the default icon title bar 2010-06-19

    Java application title bar to change the default icon Now offers two methods: Method 1: If you used the Toolkit (java.awt.Toolkit) class, which is a very simple thing: Toolkit tk = Toolkit.getDefaultToolkit () Image image = tk.createImage ("image.gif

  • Repository ubuntu to change the default path for maven 2010-11-09

    Repository maven default path is in the main directory / ~ m2 folder. After successful installation, so maven would like to change the default path, then enter the terminal :-$ ls -a The command is to check all files, including hidden files. Found. M

  • How to change the default Oracle 10g Express Edition 8080 2010-12-09

    How to change the default Oracle 10g Express Edition 8080 Select "Run SQL command", enter the following prompt SQL> First connect to the server connect username / password After landing enter the following command: Sql Code call dbms_xdb.cfg_

  • ubuntu change the default path to the maven Repository 2010-11-09

    Repository maven default path is in the main directory / ~ m2 folder. After a successful installation so maven would like to change the default path, enter the terminal :-$ ls -a The command is to check all files, including hidden files. Found. M2 fo

  • Change the default workspace eclipse 2011-03-29

    Change the default space eclipse eclipse configuration directory under the directory, open the config.ini file Will osgi.instance.area.default = item as you want to change the default workspace directory For example: osgi.instance.area.default = E \:

  • CMD change the default path 2011-08-26

    Method one: first find the file copy cmd.exe cmd.exe file (C: \ WINDOWS \ system32 \), copy it to the path below you need, double-click opens the default path is the path of the now. I personally think that this method for the java programming is the

  • How to change mysql default password 2011-09-04

    mysql installation and if it does not change the default password is not secure, preferably immediately after the change mysql default password. To note that, mysql mysql password change is required in the root privileges, the average user can not ch