问题
I get gems to work fine on my local machine, but on Cloud9 I keep getting `require': cannot load such file. I've had this problem with multiple gems and I don't know what I'm doing wrong.
I have installed the gem, added it to my gem file and did bundle install. It shows in my gem list. Here is the path for it from bundle show
/usr/local/rvm/gems/ruby-2.1.5@rails4/gems/test_linker-1.0.1
Here is my environment path
GEM PATHS:
- /usr/local/rvm/gems/ruby-2.1.5@rails4
- /usr/local/rvm/gems/ruby-2.1.5@global
回答1:
I had the same issue. The ENV variables get out of sync between the terminal and the Runner. If you run
exec 'env'
from a ruby script, it may show different GEM_PATH and GEM_HOME than you'll see from the terminal.
To sync them, I had to remove references to @rails4 from env in the ~/.profile file. (just set them in .profile to exactly what they are in the Runner.)
GEM_PATH=/usr/local/rvm/gems/ruby-2.1.4:/usr/local/rvm/gems/ruby-2.1.4@global
GEM_HOME=/usr/local/rvm/gems/ruby-2.1.4
This Runner runs ruby scripts without Rails. If you want Rails you can create a Run Configuration based on the Ruby on Rails Runner.
It would be nice if you could change the ENV variables in the individual Runners. There is an ENV button at the top right, but trying to override GEM_HOME and path there has no effect.
来源:https://stackoverflow.com/questions/28242749/i-cant-get-any-ruby-gems-to-work-on-cloud9