Rails Server is not starting on Windows 10 - ruby-on-rails

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

Related

copies a rails app to a new computer: rails command not found

I have just set up ruby and rails on a freshly installed freeBSD. It works great. I can do rails new blabla mv into blabla and do rails s and it just works.
I had an up and running rails app on another computer. I copied the repertory that contained the app to the new computer running freeBSD. However, when I mv into that repertory of the rails app and to rails server I get -bash: rails: command not found
I have tried creating a new app with the same name and let rails create all the repertories and then copy the files of the existing rails app therein but no success.
I can run rails -v and rails s from within any repertory and get correct answer, but when I move into that specific repertory I get that command not found.
You're probably using a ruby version manager I suspect (rbenv/rvm)? Check the ruby version in your Gemfile (top of the file). It probably isn't the same as the ruby version you have installed. If you're using one of the above mentioned version managers than install the correct ruby for your rails project. After that you can do a gem install bundler in the project directory and after run bundle install which will install rails and all dependencies.
Which version you are using? It happens with earlier versions. Try updating your gems and bundler. And try again. Hope it helps.
Did you try running bin/rails s? I think tha you need run bundle install too.

Beginning Ruby on Rails in Linux Mint

This may sound very basic to many of you. I have just started a Ruby on Rails tutorial in Linux. I'm very new to the Linux OS. I have installed a rvm. But I am unable to install Rails. It's saying "cant load such file --zlib". And I can see two source files for Ruby. Not sure if I have two Ruby installed.
Just take a note that you have selected the correct build system:
"Tools -> Build System -> Ruby"
Then press CTRL+B.
This should work.
You can execute .rb file in sublime using ctrl + b.
It seems you are a bit confused about how Ruby on Rails work.
Sumblime can run your ruby code but not on Rails stack.
My suggestion it's to work always with an open terminal on the directory of your rails application.
Let's assume you created a new rails project as
rails new helloWorld
The rails generetor will create a subfolder helloWorld.This will be your working directory in the terminal.
So you have to do:
cd helloWorld
and then
rails s
It will run your rails application on an embedded server on localhost:3000 by default.
What method did you use to install ruby?
If you compiled from source you may need to do
sudo apt-get install libssl-dev
And then recompile ruby
Otherwise, you may not have the most recent version of Rubygems
Try:
go to https://github.com/rubygems/rubygems/releases/tag/v2.2.3
download rubygems-update-2.2.3.gem
call the directory where the file was dl'ed, then
gem install rubygems-update-2.2.3.gem
update_rubygems --no-ri --no-rdoc
rubygems --version #Should show 2.2.3
gem install rails

install ruby on rails on windows

I need to run an application built in ruby on rails. I have installed ruby 1.9.2, rails 3.2.1, gem 1.8.15, Netbeans 6.8, glassfish v3, jdk6u30 and mysql but still, I can't get it run.
How do I install ruby on rails on WindowsXP?
I have to code on Windows at work and deploy to Linux and this is what I use
Ruby installer
Ruby Dev Kit
Install Rubygems
Open a Ruby command prompt for the next steps
gem install bundler
bundle install mysql
bundle install rails
Go to the directory you want to house your rails apps (e.g. cd \rails_source)
rails new (inserting the app name you want)
Once that is done, cd into the directory
Edit Gemfile to ask for gem 'mysql'
cd Config
edit Database.yaml to look for mysql db
cd ..
create a db for your mysql instance called _development
Go back to rails command line
bundle exec rails g scaffold (like blog_entry)
bundle exec rake db:migrate
bundle exec rake routes
Look for your desired route in the output
bundle exec rails s
Open a browser
Go to http://localhot:3000/
You should see a plain app
You can also check out Rails for Zombies which is a visual tutorial. It is not windows oriented but it helps fill in the gaps
I think its a quite simple to install ROR with mysql database on windows.
Follow the below instruction
Install Mysql Server 5.6 from [http://dev.mysql.com/downloads/mysql/] , use 32bit for XP and 64Bit for W7.
Go to mysql/bin folder under Program Files and copy and set the path in environment variable.Open command propmt and type mysql in order to check if mysql is installed correctly.
If still problem with Mysql, open run and type services.msc and check for MySQL service is started or not if not start manually.
Download ruby2.0.0, devkit 64-32 from http://rubyinstaller.org/downloads/
Download mysql connector from [http://dev.mysql.com/downloads/connector/c/] and make sure the version should be "(mysql-connector-c-noinstall-6.0.2-win32.zip)", you will find in "Looking for previous GA versions?".
Install ruby in C folder and select add path to executable while installing in first/second prompt.
Create folder devkit and extract devkit into it.
Extract mysql connector in C folder.
Open command Prompt and type ruby -v in order to check if ruby is installed, if not check ruby/bin path have to be added in environment variable.
Go to devkit folder, where you have extracted devkit, open command prompt and type ruby dk.rb init and then ruby dk.rb install.
Now we go through test, follow the instruction is given in test installation section in https://github.com/oneclick/rubyinstaller/wiki/Development-Kit and check with command starts with gem and ruby.
Create directory called dev and go inside it and type command gem install rails.
rails new app -d mysql2
Run command "bundle config build.mysql2 --no-ri --no-rdoc -- --with-mysql-dir=c:\mysql-connector[select what folder name is there for mysql connector]".
bundle install.
If still problem is exist, delete app folder and repeat command rails new app -d mysql2 again.
Go to app folder and use command rails server to start services. Check in browser with localhost:3000.
To create DB, use rake db:create in app folder.
Hope it helps.

Ruby On Rails 3.x Offline Install (without internet connection)

I really appreciate if one can provide some insight for installing ruby on rails 3.x framework to a computer without internet connection.
All the tutorials or explanations seem to assume that there is always an internet connection. Is there simple way to download a bundle with all the dependencies included and simply install the bundle.
Thanks in advance
Finally. The complete list of Gems that you need to download manually, in order to install Rails in Offline mode (or behind a proxy that prevents your "gem" commands from working).
This list assumes that you already have the following things (Windows 7):
Ruby 1.9.2
RubyGems 1.8.24
DevKit
THE LIST.
Go to rubygems.org and use the Search function to download each one of the following Gems. You don't need to type the complete name with version numbers and stuff. For example, just "actionmailer" will work and will find the latest version).
Each gem page shows you the command line you have to type when installing it normally in a computer that isn't behind a proxy. Ignore it and just click the download link.
actionmailer-3.2.6.gem
actionpack-3.2.6.gem
activerecord-3.2.6.gem
activeresource-3.2.6.gem
activesupport-3.2.6.gem
rake-0.9.2.2.gem
i18n-0.6.0.gem
multi_json-1.3.6.gem
activemodel-3.2.6.gem
arel-3.0.2.gem
tzinfo-0.3.33.gem
builder-3.0.0.gem
erubis-2.7.0.gem
journey-1.0.4.gem
rack-1.4.1.gem
rack-cache-1.2.gem
rack-test-0.6.1.gem
sprockets-2.1.3.gem
hike-1.2.1.gem
tilt-1.3.3.gem
mail-2.4.4.gem
mime-types-1.19.gem
treetop-1.4.10.gem
polyglot-0.3.3.gem
rails-3.2.6.gem
bundler-1.1.4.gem
railties-3.2.6.gem
rack-ssl-1.3.2.gem
rdoc-3.12.gem
thor-0.15.3.gem
JSON-1.7.3.gem
(31 files total)
Just keep in mind that the versions may change. I did this in June 2012 and those were the versions that worked for me.
Copy all those files to the Ruby installation dir.
Then, open a CMD console.
cd \
cd <RubyInstallDir>
gem install rails-3.2.6.gem
Installation should run normally.
It is possible that some dependencies need a different version.
In that case, the error message will show you the right version. So you just need to download the version from rubygems.org (there is a list of old versions in the gem's page) and run the gem install command again.
I hope this can help.
You can use bundler to achive that. Bundler accepts the path where you can specify the location for the gems to be installed. Run the following command where you have internet connection. It will download all the dependencies and pack them into the specified folder.
bundle install --path gems # 'gems' is the folder present in Rails.root
Now that all the dependencies are within the project, you can copy the project to the machine where you don't have internet connection. From now on use the commands like:
bundle exec rails server
bundle exec rails console
Note that you have to install the bundler gem manually in the target machine.
I know that this question refers to Rails 3, but I created PortableRails exactly because of this (which has recently been updated to support Rails 4). Just make sure that you run bundle --local instead of just bundle (which is what the new-action tries to perform).

Installing the 'responds_to_parent' plugin on Mac OS running "Snow Leopard"

I am trying to follow this tutorial to AJAXfy file uploads in my Ruby on Rails 3 application. On "Step 6. Using iframes and responds_to_parent" chapter I have to install the 'responds_to_parent' plugin but I am not able.
I use a Mac OS running "Snow Leopard", so in my Terminal I enter this:
script/plugin install http://responds-to-parent.googlecode.com/svn/trunk/
but the response is:
-bash: script/plugin: No such file or directory
What I have to enter?
BTW: "what I have to do"/"how to handle" gem and plugins for the my RoR 3 application when I will deploy it on a hosting server?
script/plugin install is no longer in rails. Use this syntax instead:
rails plugin install
All the executables inside the script directory were consolidated into script/rails with the release of Rails 3.
As far as deploying goes, using rails plugin install will add the code to your /vendor/plugins directory, so as long as you check that into your source control system, it should deploy with the rest of your code. Gems should be included in the Gemfile. You will need to use "bundle install --deployment". If you are using capistrano, there is a recipe included with bundler. More info on bundler here: http://gembundler.com/

Resources