New ruby on rails projects unrunnable


#1

I’ve recently started to learn ruby on rails and I’m using cloud9 to learn on.
However every new Ruby on Rails workspace I create gives me errors. The workspace itself creates just fine, but whenever I try to run my project (even if I don’t do anything to any file) it just gives me an error:

Warning: PATH set to RVM ruby but GEM_HOME and/or GEM_PATH not set, see:
https://github.com/rvm/rvm/issues/3212

and a little below that:
/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs’: Could not find ‘railties’ (>= 0.a) among 16 total gem(s) (Gem::LoadError)

but when I type gem list in the terminal railties shows up just fine.

I’m following my course instructions to the letter so I’m a bit confused here as to why it just won’t work…

ps. The link provided in the error msg doesn’t help as I have no clue what ~/.zshrc is or where to find it (even after a google search).

Any help would be appreciated!


#2

Hi,

Sorry for the trouble here. We have resolved the issue now, and you will need to restart your workspace to get the fix.

Please let us know if the restart doesn’t help resolve the issue for you.

Regards,
​Mutahhir


RVM error when opening new terminal
#3

Edit 2: And it’s broken again, sadly.


#4

I’m having the same issue. All of a sudden can’t run. And I’ve restarted.


#5

I am having the same issue. Any way we can fix this our selves?


#6

Was working and now I get this error as well…is there any way to fix it?


#7

Hey, this just popped up for me too. I didn’t change anything since the last successful run.


#8

Update: I notice that if I run the project straight away, right after opening it from the cloud9 dashboard, it will run successfully. However if I wait a while and then run it I get the error


#9

having the same problem… :frowning:


#10

here having the same problem too !!:fearful:


#11

Same here. Tried to restart multiple times but it still does not work.

[EDIT] After restarting again, again & again it finally works. Let’s hope it will remain well.


#12

I’ve found a solution…

Please follow this thread (last response at the end of the thread) to know the values of GEM_HOME ans GEM_PATH:

and put this in your .bashrc:

export GEM_HOME=/usr/local/rvm/gems/ruby-2.3.0
export GEM_PATH=/usr/local/rvm/gems/ruby-2.3.0:/usr/local/rvm/gems/ruby-2.3.0@global
export PATH=/usr/local/rvm/gems/ruby-2.3.0/bin:$PATH

Replace the values if it’s not the same ones…
It works for me and I hope it’s work for you :slight_smile:

Enjoy…


#14

having the same problem.
Maybe fix by a command following: rvm use ruby-2.3.0

Because of missing current ruby version on rvm.
Check rvm list

And put this in your .bashrc for execute every time.
ex. echo “rvm use ruby-2.3.0” >> ~/.bashrc
It works fine.

But having following message on starting termilal. I could’nt fix it.

Warning! PATH is not properly set up, ‘/usr/local/rvm/gems/ruby-2.3.0/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.3.0’.


#15

I ended up installing ruby 2.3.1 and then rails in order to create a new project and run commands. So far, so good.

rvm install ruby 2.3.1
rvm use ruby 2.3.1
gem install rails


#16

Both fixes suggested by mtribone and John_Carpenter don’t work for me


#17

i tried that and it didn’t work


#18

I got this issue after restarting my workspace?


#19

No issue “Warning: PATH set to RVM ruby but GEM_HOME and/or GEM_PATH not set” so far after restarting my application.
(!) However, these parameters are still not set and visible for .bashsrc (!)

At the time I have to set them and '$rvm use ruby-… ’ manually (as @john_carpenter explained above) in EVERY .bashrc I use in my app.

I am working at the time with final chapters of well-known Michael Hartl’s "Ruby on Rails tutorial’. It’s a pretty big piece of code I have already written. So it would be appalling if I lose all my job done.


#20

Sorry for the long time it took us to identify and release the fix for this issue.
It was caused by a bug in tmux 2.2. We have added a workaround for this issue, so now if you close the ide and open it in a new tab, the warning should be gone.


#21

I still see this message:

~/workspace/sample_app (master) $ rails console
bash: rails: command not found

reopening terminal or restarting workspace don’t help.