我最近安装了linux,并且正在尝试使用ruby开发。我已经成功安装了rvm,以及rails和sqlite3。我在Aptana RadRails中创建了一个测试应用程序,以确保我的安装正常工作。
不幸的是,当我尝试运行我的应用时,我收到此错误:
/ home / Daniel / Workspace / Dan_Test / Gemfile:1:in
<main>': undefined method
source'for main:Object(NoMethodError)
我无法弄清楚为什么我收到此错误。该应用程序是在'rails new'下创建的默认应用程序;我没有添加任何新代码。我也运行了bundle install,因此应该存在适当的gem。
非常感谢你的帮助!
下面是gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/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', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
答案 0 :(得分:0)
原谅我;问题是我如何安装rvm。我设置了一个bashrc中不存在的路径:source /etc/provile.d/rvm.sh,而不是/etc/profile.d/rvm.sh。这似乎导致了我的大部分问题。
感谢您的耐心等待!