Ubuntu 14.04 VPS Rails上未加载环境变量(Environment variables not loaded on Ubuntu 14.04 VPS Rails)
这让我疯狂了几天,我无法弄清楚如何解决这个问题。 我是新手,所以它可能只是非常简单。
我使用Digital Ocean在Ubuntu 14.04上设置我的VPS主机,将我的Rails 4应用程序部署到生产环境。 我按照本教程使用Capistrano和Nginx部署了我的应用程序https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-美洲狮
我目前唯一的问题是我的环境变量没有被我的应用程序加载。 或者至少,当我尝试订阅我的时事通讯时,它告诉我需要一个有效的api密钥。
到目前为止我做了什么:
- 按照文档中的说明安装rbenv-var。
- 在我的/ appname / current文件夹中创建了一个.rbenv-var文件
- 当我运行rbenv vars时,一切看起来都还可以
- 运行源〜/ .bash_profile(发现这可以解决问题,但它没有)
- 试图在某处显示“弹簧停止”,但也没有工作。 Spring没有安装
- 我也尝试将我的变量添加到我的〜/ .bashrc文件中,这也不起作用
- 尝试将它们添加到我的〜/ .bash_profile文件中,运行source~ / .bash_profile,但这也不起作用。
这是我的bash_profile文件:[[ - - “$ HOME / .profile”]] && source“$ HOME / .profile”#加载默认的.profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM$ export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)" export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH" export MAILCHIMP_API_KEY="somenumber" export MAILCHIMP_LIST_ID="somenumber"
如果需要,很高兴添加任何额外的代码。
非常感谢!
this is driving me crazy for a few days now and I can't figure out how to solve this. I am new to this so it might just be something very simple.
I set up my VPS hosting on Ubuntu 14.04 using Digital Ocean to deploy my Rails 4 app to a production environment. I deployed my app using Capistrano and Nginx by following this tutorial https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma
The only problem that I currently have is that my environment variables are not loaded by my app. Or at least, when I try to subscribe to my newsletter, it tells me that a valid api key is required.
What I did so far:
- Installed rbenv-var as instructed in the documentation.
- Created a .rbenv-var file in my /appname/current folder
- When I run rbenv vars, everything looks OK
- ran source ~/.bash_profile (found this somewhere that could solve the problem, but it didnt)
- Tried "spring stop" as indicated somewhere but didn't work either. Spring was not installed
- I also tried adding my variables to my ~/.bashrc file, that didn't work either
- Tried adding them to my ~/.bash_profile file, ran source ~/.bash_profile but that didn't work either.
This is my bash_profile file: [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM$ export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)" export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH" export MAILCHIMP_API_KEY="somenumber" export MAILCHIMP_LIST_ID="somenumber"
Happy to add any extra code if required.
Thanks a lot!
原文:https://stackoverflow.com/questions/33265843
最满意答案
一旦在其清单包名称下发布应用程序,这就是应用程序的唯一标识。 切换到其他名称会生成一个全新的应用程序,无法将其安装为现有应用程序的更新。
它无法改变它。 请阅读http://android-developers.blogspot.in/2011/06/things-that-cannot-change.html
Once you publish your application under its manifest package name, this is the unique identity of the application forever more. Switching to a different name results in an entirely new application, one that can’t be installed as an update to the existing application.
Its not possible to change it . Please read http://android-developers.blogspot.in/2011/06/things-that-cannot-change.html
相关问答
更多-
如何从Android apk获取包名和启动器活动(How to fetch package-name and launcher activity from Android apk)[2023-06-16]
Android Aapt提供此功能。 使用以下命令 一套 : D:\Android\sdk\build-tools\23.0.2>aapt d badging Apk-path\apk-name.apk |grep package b)中启动的活性: aapt d badging Apk-path\apk-name.apk |grep launchable-activity Android Aapt provides this feature. Use below commands a)package ... -
请参阅以下有关camelCased规则的链接: https : //developer.mozilla.org/en-US/docs/Web/API/HTMLElement.dataset 所以在你的情况下,我会使用: 要得到: object.DataTest; //test2 See following link regarding camelCased rule: https://developer.mozil ...
-
你可以base64编码散列的输出。 除了你提到的,还有一些其他的角色。 you can base64 encode the output of the hash. This has a couple of additional characters beyond those you mentioned.
-
您不需要任何其他模型来实现不区分大小写的登录。 Django支持通过iexact运算符进行不区分大小写的过滤: user = User.objects.get(username__iexact=name) You don't need any additional models to implement case insensitive login. Django supports case insensitive filtering by iexact operator: user = User.obj ...
-
你有没有尝试过; function f2(textarea) { string = textarea.value; alert(string); string = string.toLowerCase(); textarea.value = string; } 随着onChange的修改为; Have you tried; function f2(textarea) { str ...
-
是的,你是对的。 你应该包括你的点子requirements flake8 pep8-naming 可在此处找到其他插件/扩展。 https://pypi.python.org/pypi?%3Aaction=search&term=flake8-&submit=search Yes you are correct. You should be including in your pip requirements flake8 pep8-naming Additional plugins/extensio ...
-
使用以下select来获取名称中包含混合大小写的表 SELECT table_name ucase,lower(table_name) lcase FROM information_schema.tables where table_type = 'BASE TABLE' and table_schema = 'public' and table_name ~ E'^[[:upper:]][^[:upper:]]' PostgreSQL字符串函数 ...
-
XPath 1.0:一旦在其清单包名称下发布应用程序,这就是应用程序的唯一标识。 切换到其他名称会生成一个全新的应用程序,无法将其安装为现有应用程序的更新。 它无法改变它。 请阅读http://android-developers.blogspot.in/2011/06/things-that-cannot-change.html Once you publish your application under its manifest package name, this is the unique identity of t ...没有什么真的像'打包'。 你可以告诉Lisp,这是当前的包 。 然后,这会影响符号的进一步查找/创建(例如在读取期间)和符号的打印。 你能做的一件事是: CL-USER 53 > (cl:setf cl:*package* (cl:make-package "DADA")) #
在上面创建名为DADA的包,并将cl:*package*为它。 DADA 54 > 'foo FOO DADA 55 > (cl:d ... 相关文章
更多- 基于debian(ubuntu)的MySQL安装实录-vps环境搭建实录(四)
- 基于debian(ubuntu)的tomcat安装-vps环境搭建实录(二)
- 基于debian(ubuntu)的JDK安装与卸载-vps环境搭建实录(一)
- 基于debian(ubuntu)的nginx安装实录-vps环境搭建实录(三)
- vps安装web服务实录系列文章目录汇总
- Hadoop Ubuntu集群安装
- 在Ubuntu上安装Hadoop(单机模式)
- ubuntu下部署solr
- ubuntu下部署solr
- Rails设置环境变量
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)