Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby

Stuck building application

I installed everything using the package manager, but I think there's something wrong with my path. Is anyone familiar with this?

Aristides-Staffieris-MacBook-Pro:~ aristidesstaffieri$ rvm use 1.8.7
Using /Users/aristidesstaffieri/.rvm/gems/ruby-1.8.7-p374
Aristides-Staffieris-MacBook-Pro:~ aristidesstaffieri$ rails new treebook
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:in `activate'
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:68:in `gem'
    from /usr/bin/rails:18
Aristides-Staffieris-MacBook-Pro:~ aristidesstaffieri$

9 Answers

Chris McKnight
Chris McKnight
11,045 Points

That is a path problem. Do you have [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" in your .bash_profile or .bashrc?

I don't, it returns "directory does not exist". I'm pretty new to the command line though, not sure where I went wrong.

Chris McKnight
Chris McKnight
11,045 Points

Where do you have rvm installed? Did you do a single user installation or multiple user installation?

I did a single user installation, I think just in my user folder. Does it get installed where I unzipped the package manager?

Aristides-Staffieris-MacBook-Pro:~ aristidesstaffieri$ ls

Applications Movies Sites

Desktop Music creds-pynwheel.txt

Documents Pictures new

Downloads PrepRules.txt projects

Dropbox Public ruby-1.8.7-p174.tar.gz

Library Send Registration swoop

Chris McKnight
Chris McKnight
11,045 Points

Can you show the output of ls -a? It is supposed to installed in your user home under the .rvm folder

Thanks for your help, here it the result of ls -a

Aristides-Staffieris-MacBook-Pro:~ aristidesstaffieri$ ls -a

. .netExtender.log Library .. .netExtenderCerts Movies .CFUserTextEncoding .netextender Music .DS_Store .rvm Pictures .Trash .sass-cache PrepRules.txt .adobe .subversion Public .bash_history .zlogin Send Registration .bash_profile .zshrc Sites .bashrc Applications creds-pynwheel.txt .cups Desktop new .dropbox Documents projects .gem Downloads ruby-1.8.7-p174.tar.gz .gitconfig Dropbox swoop Aristides-Staffieris-MacBook-Pro:~ aristidesstaffieri$

Chris McKnight
Chris McKnight
11,045 Points

No problem. What does ls .rvm/scripts show?

ls -a

. .netExtender.log Library .. .netExtenderCerts Movies .CFUserTextEncoding .netextender Music .DS_Store .rvm Pictures .Trash .sass-cache PrepRules.txt .adobe .subversion Public .bash_history .zlogin Send Registration .bash_profile .zshrc Sites .bashrc Applications creds-pynwheel.txt .cups Desktop new .dropbox Documents projects .gem Downloads ruby-1.8.7-p174.tar.gz .gitconfig Dropbox swoop Aristides-Staffieris-MacBook-Pro:~ aristidesstaffieri$ ls .rvm/scripts alias gemsets patches aliases get patchsets autolibs group pkg base hash repair cd help requirements cleanup hook rtfm cli info rubygems completion initialize rvm cron install selector db irbrc selector_gemsets default irbrc.rb selector_late disk-usage list selector_parse docs maglev set env manage snapshot external migrate tools extras monitor upgrade fetch notes version fix-permissions osx-ssl-certs wrapper functions override_gem zsh

Chris McKnight
Chris McKnight
11,045 Points

Does source .rvm/scripts/rvm work? If so, what do echo $HOME and echo $PATH show? Are you by chance using zsh (I use oh-my-zsh).

it outputs no such file or directory

Aristides-Staffieris-MacBook-Pro:~ aristidesstaffieri$ echo $HOME

/Users/aristidesstaffieri

Aristides-Staffieris-MacBook-Pro:~ aristidesstaffieri$ echo $PATH

/Users/aristidesstaffieri/.rvm/gems/ruby-1.8.7-p374/bin:/Users/aristidesstaffieri/.rvm/gems/ruby-1.8.7-p374@global/bin:/Users/aristidesstaffieri/.rvm/rubies/ruby-1.8.7-p374/bin:/Users/aristidesstaffieri/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/sm/bin:/opt/sm/pkg/active/bin:/opt/sm/pkg/active/sbin

Chris McKnight
Chris McKnight
11,045 Points

Seems like an rvm file is missing. I would try removing the .rvm folder and reinstalling rvm using the curl command on the website, curl -L https://get.rvm.io | bash -s stable. Personally, I use rbenv.