Drahcir
Drahcir

Reputation: 12621

Cannot run RoR site on Cloud9 due to ruby version error

Error Logs found at the bottom of this post

I have followed this tutorial series on how to make a Ruby on Rails application on Cloud9 but ran into a snag.

I arrived at the part where I can deploy code to the Heroku server through Cloud9. In order to do this the person of the tutorial suggested changing the Ruby version to 2.1.4 from the default 2.1.5

Deployment went fine and the site runs fine on Heroku but now I have lost the ability to run it on Cloud9. Please note that my bash_profile file has the following commands:

rvm use 2.1.4
source ~/.profile

Any ideas why I am running into this issue?

Log:

Warning! PATH is not properly set up, '/usr/local/rvm/gems/ruby-2.1.4/bin' is not at first place,                                             
         usually this is caused by shell initialization files - check them for 'PATH=...' entries,                                            
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',                                                 
         to fix temporarily in this shell session run: 'rvm use ruby-2.1.4'.                                                                  
Using /usr/local/rvm/gems/ruby-2.1.4                                                                                                          
Your code is running at https://foosite-foouser.c9.io.                                                                                 

Warning! PATH is not properly set up, '/usr/local/rvm/gems/ruby-2.1.4/bin' is not at first place,                                             
         usually this is caused by shell initialization files - check them for 'PATH=...' entries,                                            
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',                                                 
         to fix temporarily in this shell session run: 'rvm use ruby-2.1.4'.                                                                  
Using /usr/local/rvm/gems/ruby-2.1.4                                                                                                          
Your Ruby version is 2.1.5, but your Gemfile specified 2.1.4 

Update

rvm list output:

foouser@foosite:~/workspace (master) $ rvm list

rvm rubies

   ruby-1.8.7-p374 [ x86_64 ]
   ruby-1.9.3-p547 [ x86_64 ]
=* ruby-2.1.4 [ x86_64 ]
   ruby-2.1.5 [ x86_64 ]

# => - current
# =* - current && default

Update 2

Output from running rails s -b $IP -p $PORT

=> Booting WEBrick
=> Rails 4.1.6 application starting in development on http://0.0.0.0:8080
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
[2015-04-17 21:29:28] INFO  WEBrick 1.3.1
[2015-04-17 21:29:28] INFO  ruby 2.1.4 (2014-10-27) [x86_64-linux]
[2015-04-17 21:29:28] INFO  WEBrick::HTTPServer#start: pid=2626 port=8080

Upvotes: 0

Views: 431

Answers (1)

Drahcir
Drahcir

Reputation: 12621

As per Mutahhir's suggestion, it was a matter of configuring the rails runner to 2.1.4

Upvotes: 1

Related Questions