I followed this to install ror,
https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm
after that, everything works fine(i think so),
but the strange thing is,
if i command rails in ubuntu terminal
it says install apt-get
however in aptana terminal,
it runs fine,
can i ask why it doesn't work in ubuntu default terminal?
do i have to setup some kind of path?
You need to change a few terminal profile preferences before you can start using rvm through gnome terminal.This article contains more information.
Related
I recently started testing out the Ubuntu bash for Windows 10 sub-system for my Ruby and Rails work. To set up rails, I followed this guide from GoRails.com.
Everything worked yesterday. But after shutting down my PC and starting up the Ubuntu bash terminal again today, it doesn't seem to recognize ruby or rails anymore. i.e. typing ruby -v gives me this:
The program 'ruby' is currently not installed. You can install it by typing:
sudo apt install ruby
Typing rails -v gives me:
bash: /mnt/c/Ruby22-x64/bin/rails: ruby: bad interpreter: No such file or directory
For reference, I used the instructions from the above guide to install Ruby 2.4.0 using RVM and Rails 5.1.1. When I ran ruby -v and rails -v yesterday, everything worked fine.
I should note, that before testing out the Ubuntu sub-system, I've been using Ruby and Rails on Windows itself - In this case, I have Ruby 2.2.5 (64-bit) installed using an installer downloaded from here. I installed Rails on Windows by running gem install rails on the Windows command prompt.
I am on Windows 10 Home Version 1703 (OS Build 15063.483)
from your story above, probably how you start the terminal (command prompt)
if you run using go rails make sure your run the terminal with bash, press start, then search for bash then you click bash icon
if you using ruby from ruby installer / rails installer you search "command prompt with ruby and rails" and click the icon
Firstly install ruby using rvm manager. It enables you to switch between different ruby versions as per your project.
Follow the instructions on this website:
http://rvm.io/rvm/install
and install ruby through rvm.
For the problem of unable to detect ruby on your system change settings for your terminal through Edit->preferences/profile preferences -> command ->(tick mark) run command as login shell.
I installed Ruby and Rails and set-up the PATH to "C:\Rails\Ruby2.3.0\bin", but when I try to run commands with rails, I get the error message:
The System cannot find the path specified.
I am able to run commands using ruby, and rails works if I use GitBash. How do I make it work on my normal command line?
Had the same problem here, installed the same way. Couldn't even run rails commands on GitBash, only way was going in C:\Rails\Ruby2.3.0\binthrough cmd and typing, for example, ruby rails new projectname. The rails new projectnamewouldn't work even in these conditions.
What I did was going in the Command Prompt with Ruby and Rails and entered gem install rails (which did not work on cmd). I also did gem install bundle. Both installed successfully and that fixed all consoles for me: cmd, GitBash (wasn't working for me), Command Prompt with Ruby and Rails and even cmder works with Rails now.
Hope this helps you.
Cheers.
If it's a simple question of locating the rails executable on Windows, then on later installs that use msys64 instead of DevKit, you'll find rails at the following folder:
c:\msys64\o-rdoc
Add this to your PATH or execute from that folder.
Your path may vary on 32-bit systems or if you changed the default install folder.
I had rails working fine for several weeks but I tried to install PostgreSQL to match Heroku and it failed to work. Now, when I open the terminal it pretend rails is not there and sets the default ruby to 1.8.7. When I start RVM it finds the right version of ruby and finds rails again and can start the server but each time I open a new shell it's back to not finding anything. Plus, the git commands don't work even after starting rvm.
I have set rvm to start by default but that doesn't work either, it has to be started manually, and it still doesn't fix the git issue.
More Detail
I am installing on Mountain Lion. This already has Postgres but the tutorial I was using suggested installing fresh using Homebrew. The trouble was the Homebrew installation installs to /usr/local/var/postgres and the installed ppstgres installs to usr/var/postgres. The system automatically uses the usr/var/postgres version, so following the tutorial I chnaged the order of usr/local/bin and usr/bin in etc/paths. That didn't help so I changed it back. Everything then went to hell so I reinstalled Mountain Lion but nothing had changed.
There are two known problems with loading RVM & default ruby:
login shell: go to terminal emulator preferences and enable login shell, sometimes it might be required to use /bin/bash --login instead.
ZSH (+ Oh-My-ZSH): go to ~/.zshrc and comment out any lines starting with: PATH= or path=(, it is still possible to use those but they need to reference itself like: PATH=$PATH:HOME/.rvm/bin or path+=( $HOME/.rvm/bin ) - which update and not reset PATH. This might be a bug in terminal emulator or ZSH ...
The git issue is explained by the reinstall of Mountain Lion which did not automatically install the command line tools. That now works. The only pain is having to load rvm every time now.
I am using ubuntu 12.04 LTS.I have successfully installed ruby via rvm and rails.I can also see which version of rails and ruby in terminal by typing rails -v,ruby -v successively.On the other hand,I have installed terminator on my ubuntu and I have faced an error message while I was typing rails -v:
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
When I have typed ruby -v,no error message,it prints the version,no problem.
Please be noted that I have already installed ruby and rails successfully and it works correctly with terminal.
Here are some pictures of the situation:
http://imageshack.us/f/819/screenshotfrom201206281.png/
http://imageshack.us/photo/my-images/407/screenshotfrom201206281.png/
I had the same problem while using rvm.
To resolve it you should add:
source ~/.rvm/scripts/rvm
to your ~/.bashrc
I had a very similar problem. Many of the commands of my rails environment were not working on Terminator and the following solved it for me.
Right click on the Terminator window. Preferences > Profiles > Command and check "Run command as login shell"
Please refer to the following post as to why this works https://askubuntu.com/questions/121073/why-bash-profile-is-not-getting-sourced-when-opening-a-terminal
Here is some more insight on shell login from RVM https://rvm.io/support/faq#shell_login
I also enconter this problem like you , rails can run on terminal but not termilator, i can't resolve it. So I use tmux instead of termilator which also can splits windows and even more stronger.
I just installed Rubymine, and Imagemagick through the terminal for use with Rails Papercilp. For some reason if I run the Rails server through terminal everything works, but if I run the server through Rubymine, it says Imagemagick is missing.
Anyone have any thoughts? I've been trying to figure out this config issue for hours now.
It is most likely that imagemagick is not in your PATH in Rubymine. The Rubymine environment is different from shell. See http://devnet.jetbrains.net/docs/DOC-1160;jsessionid=1858A969645F39423219A415388AF557 for how to do this.
probably, not the best way to handle it in general, but quick-n-dirty solution is
from terminal:
$ rvm use [environment#you_want]
(or just cd into ruby app folder if you use .rvmrc)
$ open /Applications/RubyMine.app
(or any other valid path to RubyMine installation)
this will load all necessary environment...
cheers