Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 5, master branch, use generator

For somes test, i want to try rails 5 alpha and use the generator.

I just create a new application ( rails new test )

I change the gemfile and add/replace :

gem 'rails', github: "rails/rails"
gem 'arel', github: 'rails/arel'

And i get this error :

~/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>'

How can i install the railties for rails 5 ?

like image 947
Naremy Avatar asked Dec 05 '22 21:12

Naremy


1 Answers

If you follow these steps...

git clone https://github.com/rails/rails.git
cd rails/
bundle install
cd ../
./rails/railties/exe/rails new myapp --edge --dev

...then cd into myapp folder you should see...

ruby-2.2.2 marklocklear:myRails5App marklocklear$ rails -v
Rails 5.0.0.alpha

Note the --edge and --dev options when creating the app should set the Gemfile pointing to the right place.

like image 67
Mark Locklear Avatar answered Dec 14 '22 22:12

Mark Locklear