The customer's server is Ubuntu + apache2 + ruby on rails. Currently, some pages on the customer's server always report the 500 error. The ruby language is only known and has not been studied in depth. I have never set up a ruby server environment, and it is strange that the customer uses ubuntu as the server. After installing ruby on rails on CentOS, I understand.Preface: problems after yum is installed.At the beginning, I used yum to install apache mysql ruby on rails and so on. After
here. It's because Eloquent is so powerful that it really has nothing to do with it, inherit the Eloquent class to implement many functions. For details, see the Eloquent series Tutorials: Laravel Eloquent (1)-basic concepts and usage
5. Database Filling
Run the following commands:
Php artisan generate: seed pageIn php artisan generate: seed article, two new files are displayed under./app/database/seeds/, which is our database filling file. Laravel provides automatic database filling, which is
responsible for interacting with the database. In eloquent, each table in the database corresponds to a Model class. If you turn around from another frame, you may not be comfortable with a piece of the Model you've taken here., no way, because eloquent is too strong, really nothing to do, inherit the eloquent class can achieve a lot of many functions. See Eloquent Series Tutorial: in-depth understanding of Laravel eloquent (i)-Basic concepts and usage 5. Database fills run the following comman
is very convenient.
Generator uses faker\factory as the random data generator by default, so we need to install this composer package, the address is https://packagist.org/packages/fzaninotto/faker, Install with generator in Require-dev. Specific installation Please do it yourself, you can refer to Sentry and generator, this is the first practice.
Next, change these two files individually:
Copy the Code co
Today, the system is reinstalled and the running environment of rails is re-built. Therefore, the following commands are based on the latest situation. Install Ruby one-click Installer
Note: Try not to install those new versions. Ruby and rails are not very friendly to Windows. Generally, the mswin32 versions of these class libraries are the latest. Trade rashly acts as a mouse, So you suffer. The version I installed is 1.8.6-25.
Then, add c: \ Ruby \ bin to the system variables to install Ru
will help you configure git and SSH, the installation process of a series of environment variables such as Ruby also configured OK, very good ~ Figure 1-4 Testing Ruby Installation after installing the Railsinstaller-2.2.4.exe, open the cmd command line and enter the command: RUBY–V, if, in the case of Ruby, shown in Figure 1-4, Ruby is already installed, we can also enter a command to test the version of the gem:
execute setup. Rb in the directory. After the installation is complete, run the following command to check:
Gem-V
3. Install rails
A) Remote Installation: Gem install rails-remote
The following is a description from the Internet that I didn't use this method for installation, because my network speed is too slow.
Then the output is automatically:Install required dependency activerecord?Install requi
Laravel.
5. Database Filling
Run the following commands:
The Code is as follows:
Php artisan generate: seed pagePhp artisan generate: seed article
At this time, two new files appear under./app/database/seeds/. This is our database filling file. Laravel provides automatic database filling, which is very convenient.
Generator uses Faker \ Factory as the random data generator by default, so we need to install this composer package, the address is a h
/, which is our database fill file. Laravel provides automatic database filling, which is very convenient.
Generator uses faker\factory as the random data generator by default, so we need to install this composer package, the address is https://packagist.org/packages/fzaninotto/faker, Install with generator in Require-dev. Specific installation Please do it yourself, you can refer to Sentry and generator, t
. database filling
Run the following commands:
The code is as follows:
Php artisan generate: seed pagePhp artisan generate: seed article
At this time, two new files appear under./app/database/seeds/. this is our database filling file. Laravel provides automatic database filling, which is very convenient.
Generator uses Faker \ Factory as the random data generator by default, so we need to install this composer package, the address is a https://packa
/seeds/There are two new files, which is our database populate file. Laravel provides automatic database filling, which is very convenient.
Generator defaults to using Faker\factory as a random data generator, so we need to install this composer package, the address is https://packagist.org/packages/fzaninotto/faker, With generator installed in the Require-dev can be. Specific installation please complete,
Many documents describe how to use the gem (one-click Ruby installer is already included, and you can use the gem after installation) for Remote Installation. If the network is poor, the installation will fail. I can see an article on the Internet that describes the local installation method. Now I will summarize the installation process for you.
First download them from rubyforge.net (the version may be u
/models/, there are two model files. These two classes inherit the core class \eloquent provided by Laravel.
5. Database padding
Run the following commands individually:
Copy Code code as follows:
PHP Artisan generate:seed Page
PHP Artisan generate:seed Article
At this point, there are two new files in the./app/database/seeds/, which is our database populate file. Laravel provides automatic database filling, which is very convenient.
Generator defaults to using
Http://www.cnzzad.com/tut/69566.html
Recommended:Start Network-Professional hosting and server sharing provider 17hz.net-5-year server shared rental boutique Service
From: http://developer.51cto.com/art/200908/147276.htm
It is difficult to install Ruby on Rails, but it is also very convenient. Development of applications based on RubyProgramYou must install Ruby, Gem, rails, and mongrel.
How to install Ruby on Rails
First, downl
faker instances of the PHP library, allowing you to easily generate multiple types of random data for the test.
Here to note the Faker instance, you can refer to the Https://github.com/fzaninotto/Faker
This faker instance provides a lot of available random data, such as we're going to populate the names, use $
time the installation of the E:\Program Files\bla bla ... In such a directory, the following installation of rails will appear similarto the "'E:program is not an internal or external command such errors, and later found that there may be folders in the directory there are spaces can not identify." Finally installed directly in the root directory is good ~
Enter Ruby-v at the end of the command line to test:
hoho~~ Installation S
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.