Rails re-experience

Source: Internet
Author: User
Tags redmine ruby on rails aliyun

The goal of mastering Redmine plugin development was not realized in 2016 years, and continued in 2017.

Choose the Ruby on Rails Tutorial tutorial, Windows installs Railsinstaller, which is Ruby V2.1.8, and Bitnami redmine-3.3.0 version is the same. But the rails version is 4.2.5.1, and the redmine corresponds to the 4.2.6 inconsistency. Make a Gem pack update first:

    1. Start the terminal. Note Use the Railsinstall installed after the terminal, the terminal will set the environment.
    2. Modify gem Source: Bundle config ' mirror.http://mirrors.aliyun.com/rubygems/' http://gems.ruby-china.org/' # 2017.1.7 Discover the gems.ruby-china.org is useful.
    3. Gem Install Rails–version=4.2.6–no-ri–no-rdoc

According to the book in 1.2.3 section at the command terminal to generate the first program: Rails new First_app, the following error occurred:

Run Bundle Install
Fetching source index from http://mirrors.aliyun.com/rubygems/
Net::httpnotfound

Enter the root directory of the first program: CD First_app

Re-run the bundle install, Error prompts https://rubygems.org connection authentication error, online query need to generate SSL authentication, more trouble. Directly modify the Gemfile under First_app:

SOURCE ' https://rubygems.org '

Modified to:

SOURCE ' http://gems.ruby-china.org/'

Run bundle install again to display the following error:

Using Activesupport 4.2.6

Bundler::gemspecerror:could not read gems at d:/app/coder/railsinstaller/ruby2.1
.0/lib/ruby/gems/2.1.0/cache/tzinfo-data-1.2016.10.gem. It may be corrupted.
Installing Loofah 2.0.3
Installing Mail 2.6.4
Using Rails-deprecated_sanitizer 1.0.3
Installing Globalid 0.3.7
Using Activemodel 4.2.6
Installing JBuilder 2.6.1
An error occurred while installing Tzinfo-data (1.2016.10), and Bundler cannot
Continue.
Make sure ' gem install tzinfo-data-v ' 1.2016.10 ' succeeds before
Bundling.

Follow the prompts to install the gem:

E:\05 create\code\temp\railstutorial\first_app>gem install tzinfo-data-v ' 1.201
6.10 '--no-ri--no-rdoc
Error:error Installing Tzinfo-data:
Invalid gem:package is corrupt, exception while verifying:undefined me
Thod ' size ' for Nil:nilclass (nomethoderror) in D:/app/coder/railsinstaller/ruby
2.1.0/lib/ruby/gems/2.1.0/cache/tzinfo-data-1.2016.10.gem

It seems that the current version does not support the 1.2016.10 version, and a lower version:

E:\05 create\code\temp\railstutorial\first_app>gem install tzinfo-data-v ' 1.201
5.6 '--no-ri--no-rdoc
Fetching:tzinfo-data-1.2015.6.gem (100%)
Successfully installed tzinfo-data-1.2015.6
1 Gem installed

Also modify the version in Gemfile:

Gem ' Tzinfo-data ', platforms: [: MinGW,: Mswin,: X64_mingw,: JRuby]

Modified to:

Gem ' Tzinfo-data ', ' 1.2015.6 ' , platforms: [: MinGW,: Mswin,: X64_mingw,: JRuby]

Once again, the bundle install ran successfully with 56 gems installed.

Because the version is already quite different from the tutorial (the tutorial is Ruby 2.0.0,rails 4.0.0), the gems and bundles are upgraded in the middle:

Gem Update–system

Bundle Update # Because the Rails gem version is upgraded above, it must be executed

Bundle Install # Install the required gem again, but it has not been updated

Start Rails server:rails server. The first program can be viewed through http://127.0.0.1:3000.

Rails re-experience

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.