Installing Ruby on Rails on windows - ruby-on-rails

I am in the process of installing Ruby on Rails on windows 7. I installed ruby-1.9.2 (in c:\ruby) and I've installed rails using the gem install rails command (doing this from c:\ruby\bin since this is the only place i can call the command). I've then run rails new my_app command.
The problem that I have is trying to run the rails server command from inside the apps folder (c:\ruby\bin\my_app) I get the message: 'rails' is not recognized....
What have I done wrong?

On Windows you need to set your system PATH variable (My Computer -> Properties -> Advanced -> Environment Variables -> System variables)
Append the PATH Variable value:: c:\ruby\bin;

I'm a windows 7 user, and I was able to get rails working by following this guide:
http://www.wiki.devchix.com/index.php?title=Windows_-_Rails_3
I know linking is frowned upon, but the windows 7 installations is quite detailed, and the devchix guide is excellent. I store my apps on the desktop in a folder called 'rails' not in the ruby bin.

Try Rails For The Windows installer. It allows you install Ruby and Rails on Windows in a very simple way.

Related

Rails command not working on Windows command line

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.

Rails Server is not starting on Windows 10

I am using windows 10. I install Rails and other supporting software via railsinstaller.org website.
Now I go on CMD and writing command rails server but Rails server not starting work. when I open link in firefox http://localhost:3000
Following is snapshot of output when I write rails s in cmd. I have Rails 4.2.5.1 in my PC and using Windows 10
The problem my be caused due to following (Unable to Install gems)
if you are using latest version of ruby installer to install ruby then there are problem for installing nokogiri and ulifier or other gem which needs to compailing in your pc. so you needs to install devkit first. For this please do following:
The download is a self-extracting archive. When you execute the file, it’ll ask you for a destination for the files. Enter a path that has no spaces in it. We recommend something simple, like C:\RubyDevKit\. Click Extract and wait until the process is finished.
Download from here
Next, you need to initialize the DevKit and bind it to your Ruby installation. Open your favorite command line tool and navigate to the folder you extracted the DevKit into.
cd C:\RubyDevKit
Auto-detect Ruby installations and add them to a configuration file for the next step.
ruby dk.rb init
Install the DevKit, binding it to your Ruby installation.
ruby dk.rb install
Now run bundle install
If still problem persist downgrade your ruby or install linux distro.
You need to change your directory to the app root folder.For Example if your app name is 'myapp', then type cd myapp and run rails server with rails s.
Check if the bin/rails file is in place. If not, generate a new sample app, then copy the bin folder to it.
simply add gem "tzinfo-data" to your Gemfile and run bundle install and you are good to goenter image description here

Rubymine -- Configuring remote SDK?

I am unable to get a remote SDK to run from my client workstation. It complains that the remote SDK doesn't have rails installed.
Here is my environment:
Windows 8 Workstation:
Rubymine
CentOS 7 Development Server:
rvm (installed Ruby 2.1.2)
/opt/learning_stuff (git repo with app in there)
bundle install was ran
A few diagnostic commands yield these results:
# which ruby
/usr/local/rvm/rubies/ruby-2.1.2/bin/ruby
# which rails
/usr/local/rvm/gems/ruby-2.1.2/bin/rails
How do I get rubymine to see the rails installation? Do I need to drop rvm and install from source?
In Rubymine 7.1, I used my gem directory instead of the path to the ruby executable in the "Ruby interpreter path". It found my gems for my project, and performed the sync.
Not a solution to the actual problem, but what I ended up doing is just figuring out how to make the application work on both my windows localmachine and on my linux dev box. The benefit to this is that my application is now cross platform even though I don't need it to be.

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.

Aptana Ruby on Rails Problem, rails: command not found

I installed Aptana Studio 3 and attempted to create my first Rails file, only to receive the error
sh.exe: rails: command not found
Am I supposed to edit my System Variables to include the Path? If so, where the heck is rails.exe because I cannot find that directory.
Based on your "sh.exe" filename, I am assuming you are running Windows. You will need to verify that the command "rails" is accessible in your system path so that Aptana can find it. Do this by modifying the "PATH" system variable to include the directory to your Ruby installation (this may require a restart to take affect).
Instructions for modifying the system path can be found here: http://www.computerhope.com/issues/ch000549.htm
If you used an installer of Ruby packaged for Windows such as Railsinstaller, point to the path of this installation. Gems will place executable files in the "\bin" folder. The "rails" executable is a script from the rails gem.
I have the same problem and I have solved it. I am using Windows 7 with Aptana Studio 3. The problem is that actually Rails is not installed on my Computer after I installed Aptana Studio 3.
Basically I follow the instructions given by this website
First you need a ruby installer for windows. After installation, Click on Start Command Prompt with Ruby from Start->All program->ruby folder and type gem install rails in command line and you are done. Wish that you can solve your problem as well.
Aptana Studio 3 does not install rails for you by default. You will need to download a rails installer as mentioned here:
http://wiki.appcelerator.org/display/tis/Rails+Development

Resources