I am currently studying Ruby On-Rails.
I have installed the latest version of Ruby 2.3.0 and Rails on my Mac OS terminal
If you do ruby-v, the latest version will come out.
Strangely, when I do rails server,
(Nickname)-ui-MacBook-Pro:practice NAYOON$ rails
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run rails server -h
for more startup options
=> Ctrl-C to shutdown server
[2016-03-31 02:13:00] INFO WEBrick 1.3.1
[2016-03-31 02:13:00] INFO ruby 2.0.0 (2015-12-16) [universal.x86_64-darwin15]
[2016-03-31 02:13:00] INFO WEBrick::HTTPServer#start: pid=62684 port=3000
It pops up like this. I'm very angry I had a hard time changing the Ruby version, but it doesn't change on the server ㅜㅜㅜ
The funny thing is, it works in bundle execrils.
(Nickname)-ui-MacBook-Pro:practice NAYOON$ bundle execrils
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run rails server -h
for more startup options
=> Ctrl-C to shutdown server
[2016-03-31 02:13:20] INFO WEBrick 1.3.1
[2016-03-31 02:13:20] INFO ruby 2.3.0 (2015-12-25) [x86_64-darwin15]
[2016-03-31 02:13:20] INFO WEBrick::HTTPServer#start: pid=62685 port=3000
Why is that?
ruby ruby-on-rails
Rails for rails
and rails for bundle execrils
are not the same rails.
The folder where gem is installed is located under the folder where ruby is installed.
When you do rails
, the rails installed under the ruby 2.0.0 folder are executed, and
When you do bundle exec rails
, the rails installed in the gem folder under 2.3.0 are executed.
If you use rbenv, open the terminal and enter the appropriate project folder and try rbenv local 2.3.0
. You have to do rbenvresh
.
© 2024 OneMinuteCode. All rights reserved.