installing Ruby rails, Could not locate gemfile - ruby

I'm trying to Learn ruby atm. am having alot of problems installing ruby on rails on my computer. I'm Using the one click installer and this how to install tutorial.http://www.hashemzahran.com/riding-the-rails-installing-ruby-on-rails/
My first problem i ran into was that it couldn't find the lib file. so i created and a new lib folder and believe i corrected that problem
now though when i try to run bundle install i get the error "Could not locate gemfile" i found I've been checking around through Google but have not been able to find an answer to the question. I'm running Windows 7 if that matters.
thanks for any help you can give me. I'm completely new to this.

install through this guide..
ruby on rails
try to install ruby-1.9.2-p180

Related

Moving Sinatra from Webrick to a different server on windows - thin installed but can't load eventmachine

I'm building a simple web app on Sinatra that I can deploy like a gem to artifactory; to start with I'm getting everything setup.
Here's what I've done:
I've got the the gemspec done so I can deploy like a gem
I've got sinatra modular set up with a basic 'hello world' page
I've got Rspec setup for testing (hello world test passes)
I've got rake tasks to make things easier (booting up sinatra, building the gem, running tests, etc)
Now I need to move Sinatra from Webrick to somthing a bit more robust and that's this is where I'm hitting a wall.
I've tried Unicorn,thin and Puma but they all won't install and I don't know what to do.
They all fail at Building Native extensions, I don't know what to do.
I'm using windows 8.1 (i'd rather be doing this on ubuntu but the company uses windows and to be honest I like a challenge) ruby 2.1 and I have devkit installed (and it's working now, wouldn't last night).
From what I've read Unicorn won't work on windows so the best bet is to go with thin but that fails with: extconf.rb
checking for main() in -lc... *** extconf.rb failed ***
It mentions that I need the devkit installed (it is the first line is Temporarily enhancing PATH to include DevKit...)
Despite this it fails, I tried doing what I found in this but that didn't help ( Installing event machine didn't do anything).
I'm at a loss of what to do next.
EDIT:
Whilst I've solved the problem of getting Thin to install it now has a differant error
IT can't load eventmachine.
EDIT:
It all comes down to the fact that the Devkit wasn't being recognised or it didn't install properly or something. I wonder why.
I've tried Unicorn,thin and Puma but they all won't install and I don't know what to do. They all fail at Building Native extensions, I don't know what to do.
The reason these are failing is that many ruby gems use native C extensions which expect to be compiled and installed on a linux or unix environment.
Doing any sort of Ruby development work on a Windows machine is an exercise in sadomasochism.
I strongly recommend you install VirtualBox, download an Ubuntu or similar linux virtual machine image, boot it, configure it, and use it as your development webserver. You can continue to edit your code in windows, but you will be running it in a sane environment.
Ultimately, you may have to learn some new skills, but you will save yourself an enormous amount of frustration by moving off windows as your development platform.
I managed to get thin installed but it wasn't easy
I wiped every bit of ruby from my machine, including all references in the registry, got rid of pik as well.
I then followed these steps (that I worked out along with an answer from another question) and it now works
install rubyinstaller 2.1.3
install devkit
gem install thin --platform=[win64]
notepad C:\Ruby21-x64\lib\ruby\gems\2.1.0\gems\eventmachine-1.0.3\ext\project.h #append line 97 with //
cd C:\Ruby21-x64\lib\ruby\gems\2.1.0\gems\eventmachine-1.0.3
gem build eventmachine.gemspec
move eventmachine-1.0.3.gem up one directory
cd ..
gem install eventmachine-1.0.3.gem
del the gemfile
cd
gem install thin --platform=[win64]
A bit of a job BUT it worked,
The answer in question isthis one.
specifically
2) edited the file:
c:\Ruby21-x64\lib\ruby\gems\2.0.0\gems\eventmachine-1.0.3\ext\project.h
and commented the line 97
//typedef int pid_t; for a more robust correction, checkout the
solution here
https://github.com/eventmachine/eventmachine/pull/450/files
3) then, i've opened command prompt, and went to the gem folder
c:\Ruby21-x64\lib\ruby\gems\2.0.0\gems\eventmachine-1.0.3 and run:
gem build eventmachine.gemspec
In the end, after hammering my head against a wall, on a suggestion I installed chef-client and using the embedded ruby allowed it to work, that said it only uses ruby 1.9.3 but it works so for now it will have to do.

how do I install ruby-glade-create-template ? Which is the gem that provides it?

I am on Ubuntu with ruby 1.9.1 and i am trying to build a ui with Glade. Glade outputs glade files (xml) which have to be translated to .rb . It's full of examples where "ruby-glade-create-template" is used to do this .
Seems easy except it's 2 days i have been looking for the right gem to provide that script, or for the right deb package, or for the right tarball.
From ruby-gnome2.sourceforge.jp :
ruby-glade-create-template is a program provided by Ruby/Libglade2.
Ok, and libglade is in ruby-gnome2.
Ruby-GNOME2 1.0.3 released - http://ruby-gnome2.sourceforge.jp/hiki.cgi?News_20110918_3
First option: install it as a gem - gem install gtk2
Or get:
ruby-gtk2-1.0.3.tar.gz - The minimum package which includes Ruby/GLib2, Ruby/GIO2, Ruby/ATK, Ruby/GdkPixbuf2, Ruby/Pango, Ruby/GTK2.
or ruby-gnome2-all-1.0.3.tar.gz - All of Ruby-GNOME2 libraries. (this should be the one to include libglade which has ruby-glade-create-template)
So i downloaded last tarball, ran make, and make install but still i can't find ruby-glade-create-template
Can anyone help ?
Libglade has been deprecated in favor of GtkBuilder: http://mail.gnome.org/archives/devel-announce-list/2009-May/msg00003.html
At the time the question was asked ruby-glade-create-template was in the libglade2-ruby package.
It could also be installed as part of the ruby-gnome2: https://github.com/wyhaines/ruby-gnome2/blob/master/libglade/bin/ruby-glade-create-template
About now this solution has long way been abandoned (just giving a decent end to this old question of mine ;) )

"Can't write to sqlite.dll" error in RoR on Windows

I have installed RoR in normal way as told on the RoR Guides website. It is installed, then few months ago I used it and it worked fine, now after some months when I create a new app and give this command
rake db:create
It gives the error that it can't write to sqlite.dll file, it gives the path of Ruby installation folder and its bin folder. I have downloaded and copy sqlite.exe and sql.dll in that folder also but same problem.
I thought that may be some thing is corrupted so I have reinstalled ruby and RoR. But nothing happen, same error continues. Please tell me also if it don't simply work on Windows. I am using Rails 3 and Ruby 1.9.2.

Using curb gem and libcurl on Windows

I am trying to install the curb gem, which is libcurl bindings for Ruby, and of course I need to have "A working (lib)curl installation, with development stuff" installed on my computer. So, I went to the cURL Download Wizard and downloaded this package.
But adding the bin into my PATH does not produce improvement and I still get an error when I try to install the curb gem, such as:
extconf.rb:19: Can't find libcurl or curl/curl.h
(RuntimeError)
Even though, curl is already in the PATH.
EDIT: I also tried raking the gem, as per the instructions. It fails saying "make failed" and throwing a bunch of errors like this:
C:/Ruby/lib/ruby/gems/1.8/gems/curb-0.7.7.1/ext/curb_postfield.c:76:
undefined reference to
`_imp__curl_formadd'
Execute Below command for windows only and its works
gem install curb --platform=mswin32
I realise this is a very old question, but I had this exact problem today and found the instructions on someone else's site. These worked for me so I thought I would share them since people with this issue are most likely to come across StackOverflow first: http://jes.al/2012/10/installing-curb-gem-on-windows-7/
In a nutshell:
Get the 32-bit development version of curl (see my notes below)
Add the curl bin directory to your PATH
Run the following command (replacing the paths to curl as necessary)
gem install curb --platform=ruby -- -- --with-curl-lib="C:/curl-7.27.0-devel-mingw32/bin" --with-curl-include="C:/curl-7.27.0-devel-mingw32/include"
A couple of personal notes:
Even though I am on 64-bit Windows 7, I had to download the 32-bit libcurl version under "Win32 - Generic", identified as "Win32 2000/XP zip".
I got the error c:/Ruby193/lib/ruby/1.9.1/mkmf.rb:246:in 'initialize': Permission denied - mkmftmp1.log (Errno::EACCES) while installing the gem. This rather messed up page here suggested that it might be a problem with my anti-virus, and that just retrying a couple of times might work, and indeed, it did.

Ruby Gems Problem: uninitialized constant Gem::GemRunner

I had a rails 2.2 app running, when I tried to add the latest rspec plugin to it. I did that checking it from github with the script/plugin install command. That made some rake task to stop working, I googled for a while and found that I had to upgrade RubyGems. I did that and got the following error:
uninitialized constant Gem::GemRunner
It was a small and simple app under version control, so I erased everything, and apt-get remove ruby and rubygems, and reinstalled everything once again (doing apt-get install ruby, rubygems)
The problem it's still there, and I can't figure how to solve it. I'm quite new with Ubuntu, so maybe I'm not removing the packages really? (it takes very little time to execute the apt-get removes, so I'm not very confident)
What am I doing wrong? Is that a good way to do a 'clean start' (removing via apt and then reinstalling?)
PS: I've read that the problem is solved by modifiing framework.rb, but I cant find that file in the location that the author states...
I have a blog post that solves this issue.
It's because it's still trying to use the old gem executable, so you just symbolically link the new one (gem1.8) in place of the old one.

Resources