对于某些测试,我想尝试rails 5 alpha并使用发生器. 我只是创建一个新的应用程序(rails new test) 我更改了gemfile并添加/替换: gem 'rails', github: "rails/rails"gem 'arel', github: 'rails/arel' 我得到这个错
我只是创建一个新的应用程序(rails new test)
我更改了gemfile并添加/替换:
gem 'rails', github: "rails/rails" gem 'arel', github: 'rails/arel'
我得到这个错误:
~/c/test ❯❯❯ rails g model Model table_name:string model_name:string indexes:hstore /Users/user/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'railties' (>= 0) among 9 total gem(s) (Gem::LoadError) Checked in 'GEM_PATH=/Users/user/codes/test/.gems:/Users/user/.rbenv/versions/2.2.2/gemsets/global:/Users/user/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0', execut e `gem env` for more information from /Users/user/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec' from /Users/user/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem' from /Users/user/codes/test/.gems/bin/rails:22:in `<main>'
如何为轨道5安装铁路?
如果您按照这些步骤…git clone https://github.com/rails/rails.git cd rails/ bundle install cd ../ ./rails/railties/exe/rails new myapp --edge --dev
…然后cd进入myapp文件夹你应该看到……
ruby-2.2.2 marklocklear:myRails5App marklocklear$rails -v Rails 5.0.0.alpha
注意创建应用程序时的–edge和–dev选项应该将Gemfile设置为指向正确的位置.