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

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/

Related

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

Missing step in downloading Ruby and crerating a new Ruby on Rails project on Windows

I am starting a new project that we decided to try out with Rails ... so I just installed Ruby via the Windows Installer and then, as is suggested on the Rails website, I run
gem install rails
rails new path/to/your/new/application
(replacing the path with my real project name) and I get the error that it failed complaining about JSON and that it can't build native extensions.
The Ruby on Rails home page tells you to install Ruby.
On the installer download page it says
If you don’t know what version to install and you’re getting started
with Ruby, we recommend you use Ruby 2.1.X installers
Ignore that. On the Ruby on Rails home page it says what version to install.
We recommend Ruby 2.2 or newer for use with Rails.
Then the Ruby on Rails home page says to run the following commands:
gem install rails
rails new path/to/your/new/application
cd path/to/your/new/application
rails server
The above won't work. The new rails project will fail.
What the steps above don't tell you is that, after running the installer, download and install the DevKit.
So ...
Download version of Ruby recommended on Ruby home page
Install Rails via gem install rails
Download DevKit
Then create Rails project by running last three commands above.

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

How to run or setup rails3?

Have 2 ruby installations 1.8 and 1.9.1, have 2 gems. From "gem1.9.1 install rails" installed rails3 to my system, but don't have "rails" in my "path".
How can i get rails to launch from entering rails in terminal?
EDIT
removed all ruby and ruby-gems from my system (Ubuntu 10.10) and installed ruby1.9.1 - it came with gems1.9.1 and then installed
gem1.9.1 install rails
How do i make "rails" run the installed gem rails?
EDIT 2
Found it!
The rails was installed in /var/lib/gems/1.9.1/bin/rails
just had to add a alias "rails" to it in system $PATH
How did you install your rubies? I'd strongly suggest to use a version manager like rvm, otherwise you're asking for trouble.
You should be specific about your system environment. In windows when you install ruby, you just have RUBY_HOME/bin in your path. Whenever you install rails by gem install rails , it automatically deploy executable files in RUBY_HOME/bin folder. So that you can directly execute that command.

Problem installing LESS for Ruby on Rails - script/plugin: command not found

I am trying to install LESS in a Ruby on Rails project. I am able to run the gem successfully, but when I try to install the plugin for LESS, I get an error. Here's what shows in the terminal:
MacBook:benji jesse$ sudo gem install less
Successfully installed less-1.2.21
1 gem installed
Installing ri documentation for less-1.2.21...
Installing RDoc documentation for less-1.2.21...
MacBook:benji jesse$ sudo script/plugin install git://github.com/cloudhead/more.git
sudo: script/plugin: command not found
I am a .NET developer trying to learn Ruby on Rails (on a Mac), so I am new to all this stuff.
My question's are:
Is the script/plugin command a standard command?
What does it do?
Where can I learn more about this command?
Why does it say command
can't be found?
Is the script/plugin command a standard command?
It is in rails 2, it has changed in rails 3:
rails plugin
# or
script/rails plugin
What does it do?
installs the given plugin into the RAILS_ROOT/vendor/plugin, but you should look if there is a gem version of the plugin, than you can add a gem dependency to this gem.
Where can I learn more about this command?
run the command without any parameters
Why does it say command can't be found?
try ls script/ and see if the file exists.
You have to be in the application directory. Say you created your rails app in the folder development/rails_app. You must execute the script/plugin command from there (and you don't need super user permissions for that):
cd development/rails_app
script/plugin install git://github.com/cloudhead/more.git
The plugin installation will apply only to the current rails application (in this case, rails_app). So if you create another application, you must run the script/plugin command again.

Resources