rails is not found when trying to start a new rails project - ruby-on-rails

I just installed Eclipse, then Ruby 1.9.2 then RailsInstaller. I then installed Aptana plugin for eclipse.
My directory setup are as follows:
C:\Ruby192
C:\RailsInstaller\Ruby1.8.7
When I create a new rails project in Eclipse, It throws this error:
LOL#LOL-PC /d/Projects/rail
$ rails .
sh.exe": rails: command not found
I found this solution, but it seems its for linux. I'm using Windows 7.
I reinstalled rails and ruby but its the same thing. I also had installed GitBash and GitExtensions a few months ago and had this problem. I solved it by pointing to the directory where Git was and setting the Default environment to HOME.
I now have no idea what to do to use ruby on rails in this error.

Add the place where you installed rails to your PATH environment variable. (Presumably C:\Ruby192\lib\ruby\gems\1.9.1\gems\rails*\bin)
I also noticed you are using the RailsInstaller for ruby 1.8.7 but seem to have installed ruby 1.9.2. This may cause trouble in the future.
Try following this guide for installing rails on windows. It uses gem install instead of the out dated RailsInstaller.

Related

Rubymine can't find Rails on osx

I've upgraded ruby with homebrew. Current version is 2.2.2. Installed Rails by gem. Version is 4.2.4.
Trying to build an empty rails project RubyMine stops soon saying
Can't run 'rails'. Can't find 'rails'.
I've tried both with RubyMine 7.1 and RubyMine Eap 8.
In the shell, obviously everything works perfectly. I think this happens because RubyMine uses ruby in /usr/local/Cellar/ruby/bin instead of /user/local/bin. I've tried to export "cellar" folder in $PATH, but that doesn't work. Any Ideas?
I think this happens because RubyMine uses ruby in /usr/local/Cellar/ruby/bin instead of /usr/local/bin
That sounds right. Each Ruby install has its own set of (global) gems. Make sure you have rails installed using the Ruby installed by Homebrew (not just the system Ruby).

Rails appears as not installed even though it is installed

I'm new to rails. After finally getting my environment to work properly with RVM 2.0.0 rails 4.0.5, all of a sudden rails disappeared and I keep getting the message: Rails is not currently installed on this system...
When I quit terminal, reopen it, and type:
$ rails v
It shows 4.0.5
However, as soon as I change directory into my rails app and check the rails version I get the message that rails is not installed.
Any idea what's going here?
When you use rvm you have multiple versions of ruby installed. You select which one you want like this:
rvm use 2.0
or
rvm use 2.1
You can also specify a ruby version in a .ruby-version file in a directory. Then when you change to that directory in the terminal, RVM will switch versions for you.
Each version of ruby has its own set of installed gems. Rails is a gem.
Ergo, when you installed rails, you were in your default ruby version (probably the one build-in on your system). When you change directory to your rails application, RVM is kicking in to switch to the correct ruby version for you. But you don't have rails installed in that version.
So the solution is to switch to the directory for your rails app and run:
bundle install
This will install your gem bundle for your application, including the rails gems, and it will do it into the correct ruby version.

Mac OSx Lion - Cannot get RoR installed

I recently upgraded to Lion and I am trying to install Rails. I used RubyGems to install rails and each time I tried to start a new rails project I would get an error saying, "Method 'list ' was not found".
So I unistalled Rails using RubyGems. I noticed I had two versions installed. I uninstalled both. I then ran 'gem clean'. Once again I installed Rails but now when I attempt to create a new rails application it's as if rails is not installed.
rails: command not found
I have the new Xcode command line tools installed. Can anyone help a brother out?
I believe my issue is due to the fact RubyGem does not add 'rails' to the $PATH environment variable. I was able to get everything working by installing RVM and using it to update my default Ruby and install Rails

I've broken my rails installation

Got a new machine and ported settings and files over. Went to update to Rails 3.2 and now I'm getting a list of installed gems when I run "gem list" but when I run the rails command, it tells me: Rails isn't installed.
I'm running OS X Lion and Rails 3.2. I've tried editing the path and creating a symlink and nothing seems to work. I'd be grateful for any help!
Try this tutorial and install Ruby Version Manager. It's got all the steps I followed to get ruby working on my mac.
http://seanbehan.com/mac-os-x/installing-and-using-rvm-on-mac-os-x-creating-gemsets-and-reverting-to-original-environment/

Rails 3.1 - rails not resolving (windows)

I setup rails 3.1.0.rc5 on my friends vista machine last week. Everything installed and i can run an application we're working on just fine, however, the rails command does not resolve. To start the server, i had to do the old fashioned: ruby script/rails s style. He has the ruby bin on his path, as ruby -v resolves fine. Any ideas on what to check?
Note i downloaded a 1.9.2 installer from rubyinstaller.org, setup the dev pack, and installed rails through bundler.
It sounds like your path isn't pointing to your rails gem bin.
My first suggestion was going to be use rvm but since you're on windows that won't be an option. RVM suggested pik for windows users, and if it works similar to RVM, you'll save yourself a ton of headaches.

Resources