我在Ubuntu上运行它,试图设置我的笔记本电脑,当我带回家休息。所以我可以使用我一直在做的这个RoR应用程序。这是我用它制作的第一个应用程序,对此有点新鲜!
我确保安装了相同版本的Ruby和Rails,特别是......
ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-linux]
和
Rails 4.2.6
我用我的台式机和笔记本电脑检查终端中的版本,它是一样的。
当我从github将我的项目目录克隆到我的笔记本电脑时,进入目录并运行“rails -v”检查版本,我得到....
Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler (LoadError)
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/carson/Programs/shiplist/bin/spring:8:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
我安装了gem(gem pristine executable-hooks --version 1.3.2),就像它说的那样,但我仍然得到同样的东西。
我还试过the solution here,正在运行......
rvm get stable
但它也没有用。
编辑我用笔记本电脑跟随this guide to install both Ruby and Ruby on Rails。我在Ruby上使用了rvm方法,但是如果有所不同,可能在我的桌面上使用了不同的方法。
编辑这是我的宝石文件
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
答案 0 :(得分:0)
我认为您没有安装bundler
,尝试安装gem install bundler
并再次运行。
答案 1 :(得分:0)
这是因为在笔记本电脑上ruby安装了rvm,桌面ruby安装了rbenv。他们以某种方式相互冲突,使用rbenv方式进行项目设置,然后尝试将其与rvm一起使用。
要在笔记本电脑上从rvm切换到rbenv,请转到RVM troubleshooting,然后按照“如何从系统中彻底清除所有RVM痕迹,包括系统范围的安装?”部分进行操作。
然后,返回教程here并使用创建项目的桌面上使用的rbenv和版本。
这对我来说有两台Ubuntu机器
答案 2 :(得分:0)
我认为
bundler
bin/rails
file)./bin
在您的路径中。 因此,当您在项目目录中执行rails -v
时,您的bin/rails
将运行而不是GEM_PATH中的gem可执行文件。 bin/rails
尝试加载未安装的bundler。这就是你得到错误的原因。
只需安装捆绑包。