recently i made web application and want to atatch my database with it ..though i followed steps of doing it but still i am getting error ..i dont know where's problem i did in steps .. please let me know where i am wrong
please help me where i am wrong or what i skipped ..
thankyou..
I had problems install caldecott , i got the
ERROR: Error installing caldecott:
ERROR: Failed to build gem native extension.
"C:/Program Files/ruby-1.9.2/bin/ruby.exe" extconf.rb
*** extconf.rb failed ***
error :
i found this resource : http://www.clausconrad.com/blog/installing-caldecott-on-windows
which was helpfull but my problem was i had multiple ruby installations on my system !
so make sure you are using the right ruby installation and delete the others if needed :
i had :
C:/Program Files/ruby-1.9.2/bin/ruby.exe
and
C:\Ruby193\bin\ruby.exe
i deleted the first one and everything went fine , be sure to install the devkit like the link says , and everything should be allright.
There's an issue installing eventmachine on Windows. Try this instead:
gem install eventmachine --pre
gem install caldecott
To install Caldecott requires Ruby 1.9.2.
Check version by
ruby -v
if not 1.9
update the version and re try to install
first make sure that you installed C compiler in your local computer...
if you are using Linux you can run the following command:
sudo apt-get install g++
if you are in windows you will have find a C compiler from the net.
After installing this C compiler, you can now run
sudo gem install caldecott
If this is not working, try
ruby -v
to see if the version is 1.9.3 or above....
then repeat
hope that helps
Related
I've been following along with the Lynda.com's Ruby on Rails course. I did everything just as mentioned inside the videos.
I am trying to run the rails server command, which should default to WEBrick, correct?
I run the command and it has an issue in the nokogiri.rb file and on line 29 where the error is happening this is what is read:
require 'nokogiri/nokogiri'
Which is what my command prompt is throwing up on when running the rails server command. Any idea what could be causing this? If so, what commands do I need to run to settle this? To me it sounds like something was missed when installing MySQL.
I am not sure what nokogiri is and why rails server won't run and points to that line of code.
The path to this file is (Wherever you installed the folder to)\lib\ruby\gems\2.2.0\gems\nokogiri-1.6.6.2-x64-mingw32\lib
EDIT**: I have a chain of errors, like it goes from -long path-, from -longpath- etcetera. I tried installing the latest gem, and it wasn't successful. Is there a log file I can get to share with you guys to help figure out the issue.
nokogiri is a Ruby "gem" (library) for parsing XML and HTML.
Your Rails project should have a Gemfile which specifies the name and version of each gem needed to run the project. To install the gems listed in the gemfile:
bundle install
After that install completes successfully, Rails should be able to find the nokogiri gem.
Try this
$ sudo apt-get install libxslt-dev libxml2-dev zlib1g-dev
$ sudo gem install nokogiri -v '1.5.11'
According to \lib\ruby\gems\2.2.0\gems\nokogiri-1.6.6.2-x64-mingw32\lib, which means that you are running it on Windows platform. You are using ruby 2.2.0.
I know that nokogiri conflicts with 2.2.* versions of ruby in Windows. I have already encountered this problem. I think it is because of mingw32.
You need to install 2.1.* version of Ruby in order to make Nokogiri work.
I'm following this tutorial: http://hughevans.net/2009/03/10/thinking-sphinx-dreamhost
I'm run into an issue when I run:
./configure --prefix=$HOME/local/ --exec-prefix=$HOME/local/
I get an error: "cannot find MySQL include files."
I've checked and cant find mysql_config, so I'm guessing the mysql-devel package isn't installed.
My next step is to install the mysql-devel package from source, but I'm thinking that I may be missing something.
Has anyone found a solution for this issue?
(I'm using a VPS)
My next step is to install the mysql-devel package from source
Why from source?
Suggest just using a package manager to install the package.
I solved my problem by using a different user with root access.
With that user I installed sphinx with APT.
sudo apt-get install sphinxsearch
When I try to run "rails server" on a new project it returns
Could not find gem 'mysql2 (>= 0) X86-mingw32' in any of the gem sources listed in your Gemfile.
Run 'bundle install' to install missing gems.
I ran 'bundle install' but I'm getting the same error.
I already had mysql installed from the xampp package, but my friend helped me install rails so I'm not sure how he configured it. I use Windows Vista.
Try gem install mysql2. It should then work.
I ran into this issue a while back setting up a RoR dev environment on a windows machine. Had to copy the dll to the ruby/bin folder. See the thread from ruby-forum...
http://www.ruby-forum.com/topic/150580
I had a similar issue. For me, I needed to remove the old Gemfile.lock and allow it be re-generated by running bundle update after I added the same version of mysql to the Gemfile that I had installed via "gem install mysql".
This may or may not be the issue you were running in to, but it appears this error message -> "Could not find gem 'mysql'" can be caused for this reason as well.
I had a similar issue, but when trying to gem install mysql2, it would give me a can't find header files for ruby at ... error message.
Running this fixed the issue for me: sudo apt-get install ruby-dev
I did a fresh install of jruby 1.6.2, and then wanted to install some gems.
I ran this command:
jruby -S gem install cucumber
And got this error message:
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
LoadError: OpenSSL::SSL requires the jruby-openssl gem
(root) at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:8
use_ssl= at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:124
connection_for at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:267
request at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:349
open_uri_or_path at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:306
fetch_path at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:181
load_specs at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:251
load_specs at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/maven_gemify.rb:72
list at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:224
each at org/jruby/RubyArray.java:1602
list at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:220
list at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/maven_gemify.rb:63
find_matching_with_errors at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:143
find_matching_with_errors at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/maven_gemify.rb:54
fetch_with_errors at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:83
find_gems_with_sources at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:108
find_spec_by_name_and_version at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:212
install at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/dependency_installer.rb:244
execute at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:120
each at org/jruby/RubyArray.java:1602
execute at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/commands/install_command.rb:115
invoke at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/command.rb:278
process_args at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:133
run at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:103
run at /Users/Staffr02/Development/jruby-1.6.2/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:63
(root) at /Users/Staffr02/Development/jruby-1.6.2/bin/gem:21
So then I tried this:
jruby -S gem install jruby-openssl
And I got the same error, which seemed a little odd. I'm running Mac OS 10.6.6.
I did some googling, and couldn't really find anything, except for a page that said this:
However, this breaks programs that use require 'openssl' as a test for whether openssl is available or not. Soap4r is one such program. In order to support this behavior, simply add
require 'jruby/openssl/gem_only'
So I tracked down the file that seemed to have the error (gem_runner.rb) and added the require line in there. I ran jruby -S gem install jruby-openssl again, and got this error:
ERROR: While executing gem ... (NameError)
uninitialized constant Net::HTTP::OpenSSL
Has anyone else had this problem before? I don't understand what I did wrong! Are there some independent openssl settings that I should delete first?
Any guidance would be much appreciated - thanks,
Rebecca
I've been struggling with this for a few hours. Everything just stopped working and I can't get it to work anymore. I'm a noob at Ruby, Ruby on Rails and the Terminal in general. This is really frustrating me so I just try to describe my problem as detailed as possible hoping someone can give me a solution.
I'm on Mac OS X Snow Leopard. I couldn't get Rails working at all just now: Could not find gem 'rails' headaches
But after some tries of reinstalling it, it suddenly worked again. But now I just can't get MySQL to work, and it sometimes even breaks the Rails installation again.
This is what I do:
sudo gem uninstall rails
sudo gem uninstall mysql
sudo gem uninstall mysql2
After these commands, I check the installed gems with gem list. No MySQL gem is listed anymore, but I can still see rails (2.3.5, 2.2.2, 1.2.6)
. Is this normal? Does this mean I have 3 Rails installations? It doesn't make sense to me. Anyway, then I do this:
sudo gem clean
Which fails completely. I get a bunch of errors like this:
Attempting to uninstall fcgi-0.8.7
Unable to uninstall fcgi-0.8.7:
Gem::InstallError: cannot uninstall, check gem list -d fcgi
It doesn't uninstall anything. At this point, I try to install everything again. I start with:
sudo gem install rails
Which succeeds (I think):
Successfully installed rails-3.0.3
Successfully installed builder-2.1.2
2 gems installed
Installing ri documentation for rails-3.0.3...
File not found: lib
Then, I update RubyGems:
sudo gem update --system
sudo gem install rubygems-update
sudo update_rubygems
Then it says I have 1.3.7 installed, so it succeeded, I think. So now I proceed with installing MySQL. I already got MySQL 5.5.8 installed on my machine. I did some research about installing MySQL on Snow Leopard, and it seems I have to use this command:
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
I get a bunch of errors like this:
No definition for time_set_neg
No definition for time_set_second_part
No definition for time_equal
No definition for error_errno
At this point, I assume I got both Rails and the MySQL gem installed, so I try to start a new project.
rails new user_group -d mysql
It works! Rails is installed correctly. Now, I try generating a model.
cd user_group
rails generate model User
It fails with this error:
Could not find gem 'mysql2 (>= 0, runtime)' in any of the gem sources listed in your Gemfile.
Try running bundle install.
So I try running bundle install. It installs a lot of gems. Then I try to generate my model again. I get this error:
Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.16.dylib (LoadError)
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
This is as far as I can get. What should I do? And why should this be so hard...
Snow Leopard supplies Ruby 1.8.7. Ruby 1.8.7 doesn't automatically add the require 'rubygems' command to a Ruby script, like 1.9.2 will, so in general you need to add that to your script. That fixes the problems with Ruby not finding the gems called by your code in a lot of cases. Rails is a different animal, but the version with 1.8.7 is well documented so you should have found a fix pretty quickly.
The Ruby supplied by Snow Leopard is really for its own use. Users can piggyback on that, but it's installed by Apple because they have applications that use it. Use locate podcast | grep rb$ to see. Similarly, Perl and Python in Snow Leopard are used to support code Apple has installed so messing with them is not a good idea. Changing the built-in Ruby, Perl or Python usually won't cause the system to explode in flames, but it can cause irritating and unexplained problems farther down the road when system maintenance routines stop working.
By using sudo to remove gems installed by Apple and add new ones, you've left your system Ruby in an unexpected state as far as Apple's apps are concerned. Rather than mess with Apple's Ruby, you should install a separate Ruby for your own use using Fink or MacPorts, or from source code, or by using RVM.
Personally, I use RVM because it creates a ~/.rvm sandbox in your home directory, and makes it easy to manage multiple versions of Ruby and gems. RVM requires you to install the XCode development library, which you can download from http://developer.apple.com/technologies/ after a free registration. XCode is also on your system DVD, but that version is reported to be buggy, so use the downloaded version.
Make sure to add the MySql gem to that projects gemfile with the following code:
gem 'mysql', '2.8.1'
Run a bundle install/update and try it. You told it to use MySQL and the gem might even be installed, but you aren't loading it.
Also, you're failing at a couple of points: notice the
File not found: lib
Then again, I could be completely wrong about this - it's my attempt at providing a clue for your troubleshooting.