I'm really having a hard time solving this since I don't see any possible solutions that is already written on the net, So I decided to ask a question here at StackOverflow.
Firstly, I have created a new Rails app called "MicroTwitter":
rails new MicroTwitter -T
Here the -T option to the rails command tells Rails not to generate a test directory
associated with the default Test::Unit framework.
After that, I added a few lines on the Gemfile:
group :development do
gem 'rspec-rails'
end
group :test do
gem 'rspec'
gem 'webrat'
end
And so I did a bundle install
But after minutes of waiting, It was stuck up.
C:\Users\MDF\Desktop\apps\rails apps\MicroTwitter>bundle install
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.5)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.5)
Using erubis (2.6.6)
Using rack (1.2.2)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.26)
Using actionpack (3.0.5)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.15)
Using actionmailer (3.0.5)
Using arel (2.0.9)
Using activerecord (3.0.5)
Using activeresource (3.0.5)
Using bundler (1.0.11)
Using diff-lcs (1.1.2)
Using nokogiri (1.4.4.1)
Using thor (0.14.6)
Using railties (3.0.5)
Using rails (3.0.5)
Using rspec-core (2.5.1)
Using rspec-expectations (2.5.0)
Using rspec-mocks (2.5.0)
Using rspec (2.5.0)
Using rspec-rails (2.5.0)
Using sqlite3 (1.3.3)
It stuck up just to sqlite3. To those who knew how to solve this problem, Your help is highly appreciated. Thanks!
Ok, I found out the problem.
I for got to install the "webrat" gem.
After I installed webrat:
gem install webrat
and did a bundle install again, It works like magic!
I guess I have to be more careful next time. Thank you for all the answers and comments! :)
Related
I'm trying to install the spree_wholesale gem but receiving an error when I start passenger:
git://github.com/citrus/spree_wholesale (at 0.60.x) is not checked out. Please run `bundle install` (Bundler::GitError)
Here is my Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.0.9'
gem 'passenger', '3.0.2'
gem 'mysql', '2.8.1'
gem 'spree', '0.60.1'
gem 'spree_wholesale', :git => 'git://github.com/citrus/spree_wholesale', :branch => '0.60.x'
Here is the output when I run 'bundle install'
me#me:~/w8_test$ bundle install
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.9)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.9)
Using erubis (2.6.6)
Using rack (1.2.3)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.29)
Using actionpack (3.0.9)
Using mime-types (1.16)
Using polyglot (0.3.2)
Using treetop (1.4.10)
Using mail (2.2.19)
Using actionmailer (3.0.9)
Using braintree (2.10.2)
Using activemerchant (1.15.0)
Using arel (2.0.10)
Using activerecord (3.0.9)
Using activeresource (3.0.9)
Using acts_as_list (0.1.2)
Using bcrypt-ruby (2.1.4)
Using bundler (1.0.17)
Using cancan (1.6.4)
Using daemon_controller (0.2.6)
Using orm_adapter (0.0.5)
Using warden (1.0.5)
Using devise (1.3.3)
Using faker (0.9.5)
Using fastthread (1.0.7)
Using spruz (0.2.7)
Using file-tail (1.0.5)
Using highline (1.5.1)
Using rdoc (3.9.1)
Using thor (0.14.6)
Using railties (3.0.9)
Using rails (3.0.9)
Using jquery-rails (0.2.6)
Using meta_search (1.0.5)
Using mysql (2.8.1)
Using nested_set (1.6.6)
Using paperclip (2.3.11)
Using passenger (3.0.2)
Using rd_find_by_param (0.1.1)
Using rd_resource_controller (1.0.1)
Using rd_unobtrusive_date_picker (0.1.0)
Using state_machine (0.9.4)
Using stringex (1.0.3)
Using will_paginate (3.0.pre2)
Using spree_core (0.60.1)
Using spree_auth (0.60.1)
Using spree_api (0.60.1)
Using spree_dash (0.60.1)
Using spree_promo (0.60.1)
Using spree_sample (0.60.1)
Using spree (0.60.1)
Using spree_wholesale (0.59.0.0) from git://github.com/citrus/spree_wholesale (at 0.60.x)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Here is where the gem is installed:
me#me:~/w8_test$ bundle show spree_wholesale
/home/dan/.rvm/gems/ruby-1.9.2-p180#w8_test/bundler/gems/spree_wholesale-a74adcb64660
Version 0.60 is required but you got 0.59. Try bundle update spree_wholesale.
In the branch you are referencing, the version is 0.59
Perhaps it does have something to do with Spree versions but, in my case, I wasn't even using Spree and was having this issue.
I've spent a week trying everything to resolve a similar issue. Following ALL of the troubleshooting steps here finally resolved it:
https://github.com/carlhuda/bundler/blob/master/ISSUES.md
Good luck!
Started learning ruby on rails today, after spending the half day fixing the other errors, I am stuck at the following: When I enter the following command in the terminal: " bundle exec rake db:migrate" or "rails server" it gives me the following error:
Could not find rake-0.9.2 in any of the sources
Run bundle install to install missing gems.
I ran bundle install rake (Both with version number and without) and it says it has been installed to ./rake. When I run the command it gives me the same error again. No Idea how to fix this, so any help is wholeheartedly appreciated. I am using ruby 1.9.2 and rails 3.0.9 in the directory the App is located in with RVM. Thanks in advance for any help.
EDIT:
* LOCAL GEMS *
Using rake (0.9.2)
Using abstract (1.0.0)
Using activesupport (3.0.9)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.9)
Using erubis (2.6.6)
Using rack (1.2.3)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.29)
Using actionpack (3.0.9)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.19)
Using actionmailer (3.0.9)
Using arel (2.0.10)
Using activerecord (3.0.9)
Using activeresource (3.0.9)
Using bundler (1.0.15)
Using rdoc (3.8)
Using thor (0.14.6)
Using railties (3.0.9)
Using rails (3.0.9)
Using sqlite3-ruby (1.2.5)
EDIT2: This has been fixed: Try using rvm and go back to ruby 1.8.7 instead of 1.9.2. This fixed it for me. Don't forget to install rails again (sudo gem install rails while already on 1.8.7) if you have only installed rails for 1.9.2.]
First, you should unlock the Gemfile
[root#localhost ~]#cd yourapplication [root#localhost
yourapplication]#bundle unlock
Then, edit your Gemfile, add gem rake
[root#localhost yourapplication]#vi Gemfile
+ gem 'rake', '0.9.2'
Then, update bundle
[root#localhost yourapplication]#bundle update
I guess you tried already gem install rake but it should come with rails anyway.
Well, what fl00r said in comments above, or show us the output of gem list --local
I have been trying to run the rake db:migrate command but it ain't working. I uninstalled and installed the gem but no luck. I read somewhere the o.9 wasn't stable and that 0.8.7 was ok. I tried it but I got an error also..
For now the error is
Fayimora-Femi-Baloguns-MacBook-Pro:sample_app fayimora$ bundle exec rake db:migrate
/Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:136: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:136: warning: Insecure world writable dir /usr/local in PATH, mode 040777
(in /Users/fayimora/Sites/rails_projects/sample_app)
DEPRECATION WARNING: config.generators in Rails::Railtie is deprecated. Please use config.app_generators instead. (called from /Users/fayimora/Sites/rails_projects/sample_app/config/application.rb:12)
DEPRECATION WARNING: config.generators in Rails::Railtie is deprecated. Please use config.app_generators instead. (called from /Users/fayimora/Sites/rails_projects/sample_app/config/application.rb:12)
rake aborted!
undefined method `prerequisites' for nil:NilClass
/Users/fayimora/Sites/rails_projects/sample_app/Rakefile:7
(See full trace by running task with --trace)
My gem list is
Fayimora-Femi-Baloguns-MacBook-Pro:sample_app fayimora$ bundle
Using rake (0.8.7)
Using ZenTest (4.5.0)
Using multi_json (1.0.3)
Using activesupport (3.1.0.rc4)
Using bcrypt-ruby (2.1.4)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.0.rc4)
Using erubis (2.7.0)
Using rack (1.3.1)
Using rack-cache (1.0.2)
Using rack-mount (0.8.1)
Using rack-test (0.6.0)
Using hike (1.1.0)
Using tilt (1.3.2)
Using sprockets (2.0.0.beta.10)
Using tzinfo (0.3.29)
Using actionpack (3.1.0.rc4)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.3.0)
Using actionmailer (3.1.0.rc4)
Using arel (2.1.3)
Using activerecord (3.1.0.rc4)
Using activeresource (3.1.0.rc4)
Using autotest (4.4.6)
Using sys-uname (0.8.5)
Using autotest-fsevent (0.2.4)
Using autotest-growl (0.2.9)
Using autotest-rails-pure (4.1.2)
Using bundler (1.0.15)
Using coffee-script-source (1.1.1)
Using execjs (1.2.0)
Using coffee-script (2.2.0)
Using diff-lcs (1.1.2)
Using rack-ssl (1.3.2)
Using rdoc (3.8)
Using thor (0.14.6)
Using railties (3.1.0.rc4)
Using jquery-rails (1.0.12)
Using json (1.5.3)
Using nokogiri (1.5.0)
Using rails (3.1.0.rc4)
Using rspec-core (2.0.0.beta.18)
Using rspec-expectations (2.0.0.beta.18)
Using rspec-mocks (2.0.0.beta.18)
Using rspec (2.0.0.beta.18)
Using webrat (0.7.3)
Using rspec-rails (2.0.0.beta.18)
Using sass (3.1.4)
Using sass-rails (3.1.0.rc.4)
Using spork (0.9.0.rc8)
Using sqlite3 (1.3.3)
Using uglifier (1.0.0)
Contents of Rakefile
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
# require 'rake/dsl_definition'
require File.expand_path('../config/application', __FILE__)
SampleApp::Application.load_tasks
Please any help would be apprecible. Been having a real hard time learning rails.
The bug with Rake 0.9.2 is fixed. Try using Rake 0.9.2 by adding it to your Gemfile and run
bundle update rake.
I wouldn't use Rails 3.1 RCs besides experimenting or checking your gems for compatibility. Rails 3.0.9 is pretty stable and widely supported.
Edit: https://github.com/rails/rails/issues/1197
The problem is related to a gem not being compatible with Rails 3.1. Try to remove rspec from your Gemfile, bundle install, and run your rake tasks.
I am trying to attach files in my RoR app. I am using Rails 2.0.2 and Ruby 1.8.7 for project specific purposes. I am using Ubuntu 10.04 OS.
I have tried out two plugins(paperclip and attachment_fu) but I have no luck so far in getting things working with them. I am basically facing compatibility issues as the configuration I am using is pretty much not used these days.
Kindly have a look at these URL'S in order to better understand the issues that I am currently facing:-
Undefined method `has_attached_file' with paperclip 2.3.8 gem for Rails 2 using Ruby 1.8.7
https://stackoverflow.com/questions/6000588/issues-with-attachment-fu-plugin-in-rails-2
It would be great if you can help me with your insights on these issues.
Also, can you kindly suggest plugins or gems which I can make use of to attach files in my rails app based on the above configuration.
[EDITED QUESTION]
I also would like to add I tried out paperclip 2.1.2 gem but it doesn't seem to get detected through IRB. I don't know how much of a difference this information will make, but I would like to add that I am also making use of RVM and having another ruby 1.9.2 with me.
although paperclip gem is installed and shows up in my ruby gems list , I wonder why I get a null( '[]' ) when I do a require 'paperclip' through IRB.
mohnish#mohnish-desktop:~/UP/pocs_tried_for_use/post_with_image$ gem list
*** LOCAL GEMS ***
aasm (2.2.0, 2.1.1)
action_profiler (1.0.0)
actionmailer (2.3.5, 2.0.2)
actionpack (2.3.5, 2.0.2)
activerecord (2.3.5, 2.0.2)
activeresource (2.3.5, 2.0.2)
activesupport (3.0.0, 2.3.5, 2.0.2)
acts_as_reportable (1.1.1)
aws-s3 (0.6.2)
builder (2.1.2)
cgi_multipart_eof_fix (2.5.0)
color (1.4.1)
contacts (1.2.4)
daemons (1.1.0)
fastercsv (1.5.3)
fastthread (1.0.7)
ferret (0.11.6)
gdata (1.1.1)
gem_plugin (0.2.3)
gettext (2.1.0)
hoe (2.6.2)
hpricot (0.8.3, 0.8.2)
httpclient (2.1.5.2)
image_science (1.2.1)
json (1.4.6)
json_pure (1.4.6)
locale (2.0.5)
log4r (1.1.8)
macaddr (1.0.0)
mechanize (1.0.0)
memcache-client (1.8.5)
mime-types (1.16)
mocha (0.9.8)
mongrel (1.1.5)
mysql (2.8.1)
nokogiri (1.4.3.1)
paperclip (2.1.2)
passenger (2.2.4)
pdf-writer (1.1.8)
prawn (0.8.4)
prawn-core (0.8.4)
prawn-layout (0.8.4)
prawn-security (0.8.4)
rack (1.0.1)
railroad (0.5.0)
rails (2.0.2)
rake (0.8.7)
RedCloth (3.0.3)
rfacebook (0.9.8, 0.9.0)
rmagick (2.9.1)
ruby-activeldap (0.8.3.1)
ruby-net-ldap (0.0.4)
ruby-openid (2.1.8, 2.0.2)
rubyforge (2.0.4)
rubygems-update (1.3.7)
ruport (1.6.3)
scrubyt (0.4.06)
tinyurl (1.0.0)
transaction-simple (1.4.0)
uuid (2.3.1)
xml-simple (1.0.12)
mohnish#mohnish-desktop:~/pocs_tried_for_use/post_with_image$ ruby script/console
Loading development environment (Rails 2.0.2)
ruby-1.8.7-p334 :001 > require 'paperclip'
=> []
ruby-1.8.7-p334 :002 >
Your suggestions would be really helpful,
Thank you..
If you're using a significantly older version of Rails you may be exposing yourself to serious security vulnerabilities, so if you can upgrade, you really should, even if it's just to another point release in the 2.0.x series.
That being said, you could always install a version of paperclip that's from that era. Newer versions only support 2.3 or better as far as I know.
Any project that's hosted on github will have a full version history so you can rewind the project to a particular revision that works for you. The git bisect tool is great for handling this sort of thing.
I'm trying to run rake commands on my local SQL server database using ODBC. I have setup the ODBC connections and thought I had the rails end covered however, i'm running into this error.
Please install the sqlserver adapter: gem install activerecord-sqlserver-adapter (no such file to load -- active_record/connection_adapters/sqlserver_adapter)
I have the following gems installed:
abstract (1.0.0)
actionmailer (3.0.5)
actionpack (3.0.5)
activemodel (3.0.5)
activerecord (3.0.5, 1.15.6)
activerecord-sqlserver-adapter (3.0.10)
activeresource (3.0.5)
activesupport (3.0.5, 1.4.4)
arel (2.0.9)
builder (3.0.0, 2.1.2)
bundler (1.0.10)
dbd-odbc (0.2.4)
dbi (0.4.1)
deprecated (3.0.0, 2.0.1)
erubis (2.6.6)
i18n (0.5.0)
mail (2.2.15)
mime-types (1.16)
minitest (2.0.2, 1.6.0)
odbc-rails (1.5)
polyglot (0.3.1)
rack (1.2.2)
rack-mount (0.7.1, 0.6.14)
rack-test (0.5.7)
rails (3.0.5)
railties (3.0.5)
rake (0.8.7)
rdoc (3.5.3, 2.5.8)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.25)
Am I missing a gem? What else do I need to get this running on my windows box?
Thanks in advance for any help :-)
Try to add such line in your %APP_ROOT%/Gemfile
gem 'activerecord-sqlserver-adapter'
Also, your way behind on the times. First the DBI/DBD-ODBC were removed from the adapter stack about a year ago. Also, the easiest way (and best performance) is to use TinyTDS for the connection mode. See there wiki here.
https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Using-TinyTds