RVM question

I have a bit of a chicken & egg problem:

Assume I have a top level directory for all my Rails projects. Each
project
might be using a different version of Ruby and Rails.

How do I run a “rails new foo” with the correct ruby version and gemset?

Is there some sort of cmd line argument I can use?

-joe

rvm use [email protected]
Am 19.04.2015 03:06 schrieb “jmcguckin” [email protected]:

You could also create a custom .rvmrc file for each project folder, in
which you could specify the ruby version and gemset to use (or create if
doesn’t exist’).

Att,

[image: --]
Antonio Augusto
[image: http://]about.me/aaugusto
http://about.me/aaugusto?promo=email_sig

https://www.facebook.com/augustobr https://twitter.com/xtrdev
http://br.linkedin.com/in/antoniobr/ https://github.com/antoniosb
[image:
http://about.me/aaugusto] http://about.me/aaugusto
https://plus.google.com/u/0/111953897116031502239/

2015-04-19 4:05 GMT-03:00 Norbert M. [email protected]:

On Sunday, April 19, 2015 at 2:06:08 AM UTC+1, jmcguckin wrote:

How do I run a “rails new foo” with the correct ruby version and gemset?

Is there some sort of cmd line argument I can use?

rails 4.1.10 new

Should invoke that version of the rails executable (this is a rubygems
thing - it should work with any executable provided by a gem.

Fred

I always begin new rails projects by first creating the project
directory

$ mkdir foo
$ cd foo/

$foo/

Once in the directory I make a .ruby-version and .ruby-gemset file

$foo/ touch .ruby-version .ruby-gemset

In the ruby-version file you just specify the version of ruby you wish
to
use

2.2.1

and the ruby-gemset file you name the gemset you’d like to use

fooapp

Once you have those saved you can reload the current directory by

$foo/ cd .

Then just rails new . and then bundle install

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs