I have two versions of Ruby (1.8.7 and 1.9) installed to indicate which one is for rails? or does it matter

I have Ruby 1.8.7 and 1.9 install. I run different ones, specifying ruby ​​or ruby1.9 when running the commands. eg

ruby --version

or

ruby1.9 --version

however, when I want to create a new rails application, the available command is rails, such as:

rails my_app_name

How do I specify when I invoke the rails command to create a new rails application, or does it matter? I mean, if I create it with one version, it will be the same code of another version or the user code of the script generator for different versions of Ruby.

Thanks,

There

+3
source share
4 answers

- -S. , , Ruby 1.9 :

# Create new Rails project with Ruby 1.9
ruby1.9 -S rails new_app

# Run the project with Ruby 1.9
ruby1.9 script/server

#install new gems for Ruby 1.9
ruby1.9 -S gem install some_gem

# Use Rake with Ruby 1.9
ruby1.9 -S rake something

Ruby - 1.8.7, , -S.

+3

/mod _rails ( Mac OSX Snow Leopard). conf (apache) apache ( nginx), , "PassengerRuby". , ( apache ).

RVM . apache apache Mac OSX snow leopard 1.8.7, , 1.8.6 RVM. , . :

# Default passenger
LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so
PassengerRoot /Library/Ruby/Gems/1.8/gems/passenger-2.2.5
PassengerRuby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

# Use RVM 1.8.6 ruby
# LoadModule passenger_module /Users/dylanfm/.rvm/gems/ruby/1.8.6/gems/passenger-2.2.5/ext/apache2/mod_passenger.so
# PassengerRoot /Users/dylanfm/.rvm/gems/ruby/1.8.6/gems/passenger-2.2.5
# PassengerRuby /Users/dylanfm/.rvm/bin/ruby-1.8.6-p383
+2

, .

0

Unix. ruby1.8/1.9 ruby, gem1.8/1.9 gem .. - :

ln -sf /usr/bin/ruby1.8 /usr/bin/ruby
ln -sf /usr/bin/gem1.8 /usr/bin/gem
...

ruby ​​/gem/rake/etc. . use18, , use19.

0

Source: https://habr.com/ru/post/1717814/


All Articles