0

When I run compass watch on tty7 using the bash terminal in my Ubuntu 14.04 (Ctrl+Alt+T) it's all jolly good. However, whenever I try tty1 to tty6, it comes back with the error below:

/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find compass (>= 0) amongst [bundler-1.6.2, bundler-unload-1.0.2, executable-hooks-1.3.2, gem-wrappers-1.2.5, rubygems-bundler-1.4.4, rvm-1.11.3.9] (Gem::LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs'
    from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
    from /usr/local/bin/compass:22:in `<main>`

If I simply run sass, a similar error is observed, but with sass in place of compass. Thus I think this problem is related to Ruby gems in general.

When I run whereis sass, the output is sass: /usr/local/bin/sass. I have checked in tty1 to tty6 that /usr/local/bin is in the $PATH variable. I have tried re-installing or just plain installing it again but each time the same error is thrown.

The environment is different on tty1 compared to the terminal, you can see the differences here. As you can see, the $PATH variables are the same (albeit in different order), and that usr/local/bin, where the gems are installed, are present in both.

Only when I use rvmsudo gem install did it work. Why does Sass or Compass start in tty7 but not tty1 to tty6? (without me having to install it again)

Community
  • 1
  • 1
dayuloli
  • 16,205
  • 16
  • 71
  • 126
  • Are they sharing the same environment variables or are you running any gemset et. al.? It's most likely not installed. – Henrik Andersson Dec 26 '14 at 09:26
  • @limelights please excuse my stupidity, but I installed it on tty7, it works. I need to install it again on tty1 again? I run `whereis compass` and it says `/usr/local/bin/compass` – dayuloli Dec 26 '14 at 11:12
  • Possible duplicate: http://stackoverflow.com/questions/6278047/could-not-find-rails-0-amongst-gemloaderror, http://stackoverflow.com/questions/21866380/rvm-sass-compass-issue-with-localhost-sites, http://stackoverflow.com/questions/18852242/to-specs-could-not-find-chef-0-amongst-gemloaderror – cimmanon Mar 16 '15 at 15:41

2 Answers2

1

You haven't specifing anything about your running environment / OS / terminal emulator / shell, so it's hard to give any solid diagnostics.

However, it's fairly clear that environment you get in the shell on tty1-6 and the shell you get in a terminal emulator (in X session?) is different.

If I were you, I'd try the following trick:

  • run env >env-tty1 on tty1
  • run env >env-term in your terminal emulator
  • see what's the difference between them, i.e. diff -u env-tty1 env-term

Given that you're using RVM, probably the problems are either with PATH or some other environment variable missing.

Chances are they're set in some file like .bashrc or .bash_profile or .profile - and your bash shell is started slightly differently by login(1) on tty1 and by your terminal emulator on tty7. Probably moving everything to .bash_profile could help.

GreyCat
  • 16,622
  • 18
  • 74
  • 112
  • @dayuloli: You've just posted a password for your SMTP server account in public in that file. At the very least, don't forget to change it. – GreyCat Mar 19 '15 at 16:31
0

Look like you are using RVM but it is not loading on tty 1 to 6. Does it work if you load RVM after login with:

PATH=$PATH:$HOME/.rvm/bin
source ~/.rvm/scripts/rvm

(or whatever RVM related lines that are in your .bashrc or .bash_profile files)

zwippie
  • 15,050
  • 3
  • 39
  • 54
  • I don't have an `.rvm/` directory in my home directory in any of the terminals. – dayuloli Mar 16 '15 at 16:04
  • But did you originally install/use RVM? Because it is mentioned in your error description. – zwippie Mar 16 '15 at 16:13
  • @zwippe Thank you for your answer and sorry for the confusion (I'm so confused), I am reinstalling `rvm` now. I deleted it in error when trying suggestion. Guess the best place to start is from nothing! – dayuloli Mar 16 '15 at 16:14
  • Can you explain why even after I deleted the `.rvm/` directory, Compass and Sass still ran fine? When I ran whereis [sass / compass] I get `/usr/local/bin/[sass / compass]` – dayuloli Mar 16 '15 at 16:18
  • That is because bundler installed it there, not RVM. Bundler install gems to `/usr/local` (unless you specified another folder). – zwippie Mar 16 '15 at 19:06