开发者

Bundler and Rails looking at different gems?

开发者 https://www.devze.com 2023-04-01 16:11 出处:网络
This has driven me crazy.I changed laptop and tried getting my Rails environment working again.Mac OS X has its own ruby, but I used brew and installed new. 开发者_开发问答 I installed rails 3.0.5, ra

This has driven me crazy. I changed laptop and tried getting my Rails environment working again. Mac OS X has its own ruby, but I used brew and installed new. 开发者_开发问答 I installed rails 3.0.5, ran:

bundle install

Then:

rails s

I got this error:

Could not find aws-s3-0.6.2 in any of the sources
Run `bundle install` to install missing gems.

After bashing my head against a wall for a couple hours, I tried just manually installing the gems and it worked! So, apparently, rails and bundler are looking at different places for my gems. Both are from my brew install.

How can I figure out what each is looking at so I can use "bundle install" again?


Rails and Bundle are looking at the gems providing they are in the bundle.

Use the

bundle show

command to see the gems Rails is having access to via bundler.

Also you can examine the Gemfile.lock file.


The gemfile sources mainly from rubygems.org as supposed to rubyforge (which came up when i searched that gem on google). I think the gem command will check both. You can specify additional sources, as mentioned in the readme: http://gembundler.com/man/gemfile.5.html


Are you using pow? I've been having this issue with Pow starting up with one version of ruby, but not the version that I have RVM currently set to.

I have not tried it yet, but this issue on Github mentions the problem and refers people to the Pow trouble shooting here. I've pasted the contents below:

RVM

Incorrect ruby or gemset is being used

Create a .rvmrc at your project root. See rvmrc docs.

System-wide RVM install

If you have a system-wide RVM install and are getting the error LoadError: no such file to load -- bundler/setup, run rvm info to find out where rvm is installed on your machine, then do this:

echo "export POW_RVM_PATH=/usr/local/rvm/scripts/rvm" >> ~/.powconfig

Where /usr/local/rvm/ is the location of your rvm installation.

Then restart POW by killing it in the Activity Monitor or in Terminal.

0

精彩评论

暂无评论...
验证码 换一张
取 消