fanchyna fanchyna - 1 year ago 158
Ruby Question

Installing Jruby changes default paths of Ruby and Rails

I am new to Ruby and Rails, and have been following the tutorial on this website:

I installed Ruby 2.2.1 and Rails 4.2.6. I used

to install Ruby and
to install Rails.

To start the web server, I need to have a Javascript runtime. I choose therubyrhino. To install it, I need to first install JRuby. I used
to install it

$ rvm install jruby

After that I found that the default path of Ruby and Rails are both changed to:


This causes problems because I even cannot run

$ ruby -v


$ rails -v

I could not start the web server

$ bin/rails server
TypeError: no implicit conversion of Regexp into String
join at org/jruby/
<top> at /home/jxw394/rails-projects/blog/bin/spring:11
load at org/jruby/
<top> at bin/rails:3

Why does installing JRuby change everything? What should I do to get the webapp running?

Edit: sorry I made a typo: it should be "therubyrhino" instead of "therubyracer". This has been corrected above.

Edit: sorry, I made a typo: I installed jruby using rvm instead of gem. This has been corrected above.

Answer Source

You don't need jruby in order to install therubyracer. You only need to comment out therubyracer entry in Gemfile

gem 'therubyracer', platforms: :ruby

One another way which doesn't involve therubyracer is to install node.js.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download