1

First, I have searched many questions on here that are related and tried several solutions, but I am not having any luck. Preface: I am VERY new to Ubuntu and Ruby, though I have much C++ experience. I am running a virtual machine in Windows 7 to use Ubuntu 11.10. I am working on a larger project as a home contractor, and I AM using RVM. After several days of working on the project fine, I decided to shut down Ubuntu instead of just suspend its virtual machine. Now, when I use "rails s" (which started my server fine all week) it says

The program 'rails' is currently not installed.  You can install it by typing:
sudo apt-get install rails

I am really hesitant to use sudo apt-get because of other answers I have read on here. I think I need to add something to .bashrc but so far I haven't had any luck. Thank you very much!


UPDATE It turns out the .rvmrc was removed from the repo by someone else and it didn't apparently matter until I rebooted, so what I ultimately had to do was rvm use 1.9.2 --default (to change RVM back to my correct version) and then, in my project root folder, rvm --create --rvmrc 1.9.2@myprojectnamehere followed by another bundle install. No idea if this will help someone else but I hope so

  • try running `gem list` and see if rails appears on the list – marcio Dec 17 '11 at 01:34
  • you are correct that you should not be using aptitude for this. Do you have rvm working even though rails is not? Perhaps a `rvm use 1.8.7` etc will do the trick – prusswan Dec 17 '11 at 01:59
  • Running gem list now says I only have bundler and rake (I have many more that I can see in my file directory). I did rvm use 1.9.2 (version we are using for this project) but I still cannot use rails s like I did yesterday. I ran gem environment and it looks like all the file paths are correct... – Jamie Cannon Dec 17 '11 at 02:04
  • prusswan you were definitely on the mark, somehow it was set to 1.8.7 instead of the 1.9.2 we have been using the whole time, when I set it to rvm use 1.9.2 --default I had to do a bundle install again and now it seems rails s works. Wow I really am new at this. Thank you so much. If you posted an answer I would vote for it (I'm also new to stack overflow, forgive me!) – Jamie Cannon Dec 17 '11 at 02:22

1 Answers1

0

I've put rails 3.1 on two Ubuntu 11.10 boxes. Install rvm as follows (as root)

  bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )

After rvm is installed as root again, install ruby 1.9.3 in the rvm, change the default rvm to 1.9.3. (rvm use --default 1.9.3). Now make sure the rvm scripts are loaded into /etc/profile.d it may be necessary to source /etc/profile in your users' .bashrc file.

After this simply calling gem install rails etc will suffice.

Do not use aptitude for ruby or rails.

lukecampbell
  • 14,728
  • 4
  • 34
  • 32
  • Thank you, sorry I did not see your answer sooner, about 15 min before you posted I sorted it out w/my coworker and updated the question. But this is basically what was needed, my rvmrc file was no longer correct. – Jamie Cannon Dec 29 '11 at 22:52