如何使用Rails 6的Alpha版本?

时间:2018-11-08 00:46:07

标签: ruby-on-rails

我想为我的应用程序使用Alpha版本的rails。它在rubygems.org上不可用,所以我在Gemfile中使用它:

gem 'rails', github: 'rails/rails', branch: 'master' # Use rails 6.0.0.alpha, FIXME: to be updated on rails release

bundle install经过了:

...
Installing sprockets 3.7.2
Fetching sprockets-rails 3.2.1
Installing sprockets-rails 3.2.1
Using rails 6.0.0.alpha from git://github.com/rails/rails.git (at master@5df4efd)
Bundle complete! 1 Gemfile dependency, 40 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

但是rails --version显示出奇怪的输出(我在Mac上使用的是RVM):

rails --version
Rails is not currently installed on this system. To get the latest version, simply type:

    $ sudo gem install rails

You can then rerun your "rails" command.

但是bundle info rails似乎还可以:

The git source `git://github.com/rails/rails.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
  * rails (6.0.0.alpha 5df4efd)
    Summary: Full-stack web application framework.
    Homepage: http://rubyonrails.org
    Path: /Users/ro/.rvm/gems/ruby-2.5.1/bundler/gems/rails-5df4efd2fd08

如何修复我的Alpha rails命令?

1 个答案:

答案 0 :(得分:1)

已修复

rvm remove ruby-2.3.1(红宝石的旧版本)

我也有旧的gemset,像rvm gemset list_allrmv gemset list这样的命令会很有帮助。