2
$ rails g twitter_auth
/Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require': no such file to load -- twitter_auth/engine (LoadError)
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require'
    ...

有人知道我可能会错过什么吗?我认为这是直截了当的。

#Gemfile
gem "twitter-auth", :require => "twitter_auth/engine"

然后 :

bundle install
4

1 回答 1

3

It looks like you're probably trying to use one of the forks of twitter-auth (perhaps trotter's fork or jaikoo's fork?). Both look like they have slightly misleading readmes because they suggest you can install from rubygems. However, the gem 'twitter-auth' is the main branch of the plugin, by mbleigh which doesn't work with Rails 3 yet by the looks of it.

If you're wanting to use one of these forks which work with Rails 3, you need to specify their git repo in your Gemfile. For example, for jaikoo's fork:

gem "twitter-auth", :git => "git://github.com/jaikoo/twitter-auth.git", :branch => "rails_3", :require => "twitter_auth/engine"

Then rails g twitter_auth should work as expected.

于 2011-01-21T12:55:02.533 回答