I cant run "bundle install" or install bundler without sudo - sudo su



Hello everyone!

I’m new on Cloud9 IDE.
I cloned my Git repository. The project is in ruby 2.5.0. To install this version, I used sudo su in the terminal with the command "rvm install ‘ruby-2.5.0’.

After that, I tried to install the “Bundler” and the following errors were presented:
When i Tried the command “Bundle install”

Traceback (most recent call last):
    4: from /usr/local/rvm/gems/ruby-2.5.0/bin/ruby_executable_hooks:24:in `<main>'
    3: from /usr/local/rvm/gems/ruby-2.5.0/bin/ruby_executable_hooks:24:in `eval'
    2: from /usr/local/rvm/gems/ruby-2.5.0/bin/bundle:23:in `<main>'
    1: from /usr/local/rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'

/usr/local/rvm/rubies/ruby-2.5.0/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe’: can’t find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)

I’m trying install bundler with “gem install bundler”, but i dont have permission. The follow error were presented:

ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /usr/local/rvm/gems/ruby-2.5.0 directory.

I dont find any manual to setup a Ruby on Rails project on Cloud9.