2011-01-14 8 views
0

나는 그 아래에 다른 프로젝트를 가지고있는 레일 프로젝트를 가지고 있는데, 서브 프로젝트는 갈퀴와 bundler 파일을 가지고있다.Rails3과`cd somehwere && do something`

예상과 하위 프로젝트 레이크을 사용할 때 내가 루비 -e 'CD 하위 프로젝트 & & rake`, 또는 루비 -e'CD 하위 프로젝트 & & bundle`, 작업 명령을 수행 할 때/bundler 파일. 그러나 Rails3 콘솔 (레일 3.0.3)에서 동일한 작업을 수행 할 때 rake는 로드 할 파일이 없습니다. - 이니셜 라이저 및 루트 디렉토리에서 실행 된 것처럼 번들이 작동합니다.

나는 Rails2.3.10 콘솔에서 같은 명령을 시도하고 예상대로 작동했습니다. 여기 Rails3에서 잘못된 것이 있습니까?

저는 RVM을 통해 Ruby 1.9.2를 사용하고 있습니다.
$ 루비 -v
루비 1.9.2p136 (2010-12-25 개정 30365)는 i686 - 리눅스]

+0

레일즈 서브 프로젝트 란 무엇입니까? – Heikki

+0

레이크 및 번들러 파일이있는 서브 디렉토리 만 –

+0

Rails 콘솔에서'Dir.pwd'는 무엇을 인쇄합니까? –

답변

1
bold_rewards ∴ ruby -v 
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.5.0] 
bold_rewards ∴ rake -T | wc -l 
     46 
bold_rewards ∴ cd vendor/plugins/pretty_flash 
pretty_flash ∴ rake -T | wc -l 
     6 
pretty_flash ∴ cd ../../.. 
bold_rewards ∴ rails c 
Loading development environment (Rails 3.0.3) 
>> Dir.pwd 
=> "/Users/george/work/bold_rewards" 
>> `rake -T | wc -l`.chomp.strip 
=> "46" 
>> Dir.chdir 'vendor/plugins/pretty_flash' 
=> 0 
>> Dir.pwd 
=> "/Users/george/work/bold_rewards/vendor/plugins/pretty_flash" 
>> `rake -T | wc -l`.chomp.strip 
=> "6" 
>> Dir.chdir Rails.root 
=> 0 
>> `rake -T | wc -l`.chomp.strip 
=> "46" 
>> 

불행하게도, 내가 Bundler를이 균열 훨씬 강하다는 너트 생각 :

increment ∴ cat Gemfile                                       
source 'http://rubygems.org' 

gem 'rails', '3.0.3' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 

gem 'sqlite3-ruby', :require => 'sqlite3' 

# Use unicorn as the web server 
# gem 'unicorn' 

# Deploy with Capistrano 
# gem 'capistrano' 

# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+) 
# gem 'ruby-debug' 
# gem 'ruby-debug19' 

# Bundle the extra gems: 
# gem 'bj' 
# gem 'nokogiri' 
# gem 'sqlite3-ruby', :require => 'sqlite3' 
# gem 'aws-s3', :require => 'aws/s3' 

# Bundle gems for the local environment. Make sure to 
# put test-only gems in this group so their generators 
# and rake tasks are available in development mode: 
# group :development, :test do 
# gem 'webrat' 
# end 
increment ∴ cat vendor/subproject_x/Gemfile                                  
source 'http://rubygems.org' 

gem 'net-ssh' 

increment ∴ rails c                                        
Loading development environment (Rails 3.0.3) 
>> Dir.pwd 
=> "/Users/george/tmp/increment" 
>> `BUNDLE_GEMFILE="vendor/subproject_x/Gemfile" bundle install` 
=> "\e[31mCould not find net-ssh-2.0.24 in any of the sources\e[0m\n" 
>> Dir.chdir 'vendor/subproject_x' 
=> 0 
>> Dir.entries '.' 
=> [".", "..", "Gemfile", "Rakefile"] 
>> Dir.pwd 
=> "/Users/george/tmp/increment/vendor/subproject_x" 
>> `BUNDLE_GEMFILE="Gemfile" bundle install` 
=> "\e[31mCould not find net-ssh-2.0.24 in any of the sources\e[0m\n" 
>> Dir.chdir Rails.root 
=> 0 
>> Dir.pwd 
=> "/Users/george/tmp/increment" 
>> `BUNDLE_GEMFILE="vendor/subproject_x/Gemfile" bundle install` 
=> "\e[31mCould not find net-ssh-2.0.24 in any of the sources\e[0m\n" 
>> quit 
increment ∴ cd vendor/subproject_x                                     
subproject_x ∴ bundle install                                      
Fetching source index for http://rubygems.org/ 
Installing net-ssh (2.0.24) 
Using bundler (1.0.7) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. 
subproject_x ∴ 
+0

레이크에서는 작동하지만 번들에서는 작동하지 않습니다. –

+0

스택 추적 또는 오류 메시지를 제공 할 수 있습니까? –

+0

번들러에 대한 답변을 업데이트했습니다. Bundler 출처를 조사하면서 소싱 문제를 파악하려고했지만 운이 없었습니다. –